]>
git.saurik.com Git - apple/security.git/blob - OSX/libsecurity_transform/misc/base32alpha2vals
3 # Quick & dirty, gennerate the Base32XVals for a given alphabet
8 die "usage: $0 base32alphabet\n";
10 my $alphabet = $ARGV[0];
11 if (32 != length($alphabet)) {
12 die "alphabet needs exactly 32 charactors";
15 my @vals = (0xff) x
256;
16 $vals[ord('=')] = 0xee;
18 for(my $i = 0; $i < length($alphabet); $i++) {
19 my $ch = substr($alphabet, $i, 1);
26 for(my $i = 0; $i < @vals; $i++) {
27 printf "0x%02x, ", $vals[$i];
28 print "\n" unless (($i-2) % 11);