changeset 3574:08ee6a4ed96e HEAD

Added %R and %H documentation
author Timo Sirainen <tss@iki.fi>
date Sun, 11 Sep 2005 23:25:04 +0300
parents 85e509808c30
children e1888f3d3423
files doc/variables.txt
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/doc/variables.txt	Sun Sep 11 23:22:35 2005 +0300
+++ b/doc/variables.txt	Sun Sep 11 23:25:04 2005 +0300
@@ -21,6 +21,13 @@
  %L - lowercase
  %U - uppercase
  %E - escape '"', "'" and '\' characters by inserting '\' before them.
+ %R - reverse the string
+ %H - take a 32bit hash of the variable and return it as hex. You can also
+      limit the hash value. For example %256Hu gives values 0..ff. You might
+      want padding also, so %2.256Hu gives 00..ff. This can be useful for
+      example in dividing users automatically to multiple partitions. Note
+      that if you're hashing usernames being in user@domain form, you probably
+      want to reverse the string to get better hash value variety, eg. %3RHu.
 
 You can take a substring of the variable by giving optional offset followed
 by '.' and width after the '%' character. For example %2u gives first two