… | |
… | |
118 | |
118 | |
119 | sub enc_STRING { |
119 | sub enc_STRING { |
120 | # should use encode for speed and clarity ;) |
120 | # should use encode for speed and clarity ;) |
121 | $data .= pack "v*", map ord, split //, $_[0]; |
121 | $data .= pack "v*", map ord, split //, $_[0]; |
122 | } |
122 | } |
|
|
123 | |
|
|
124 | sub enc_password { |
|
|
125 | require Math::BigInt; # I insist on 32-bit-perl.. should use C |
|
|
126 | # $hash must be 64 bit |
|
|
127 | my $hash = new Math::BigInt; |
|
|
128 | $hash = $hash * 1055 + ord for split //, $_[0]; |
|
|
129 | enc_U64 $hash; |
|
|
130 | } |
|
|
131 | |
123 | ]]> |
132 | ]]> |
124 | |
133 | |
125 | ############################################################################# |
134 | ############################################################################# |
126 | # types |
135 | # types |
127 | <xsl:apply-templates select="descendant::type"/> |
136 | <xsl:apply-templates select="descendant::type"/> |