public
Last active

  • Download Gist
Unicode::Digits
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
package Unicode::Digits;
 
use Exporter 'import';
our @EXPORT = qw(digits_to_int);
 
my %h;
@h{0x00000030 .. 0x00000039} = (0 .. 9);
@h{0x00000660 .. 0x00000669} = (0 .. 9);
@h{0x000006f0 .. 0x000006f9} = (0 .. 9);
@h{0x000007c0 .. 0x000007c9} = (0 .. 9);
@h{0x00000966 .. 0x0000096f} = (0 .. 9);
@h{0x000009e6 .. 0x000009ef} = (0 .. 9);
@h{0x00000a66 .. 0x00000a6f} = (0 .. 9);
@h{0x00000ae6 .. 0x00000aef} = (0 .. 9);
@h{0x00000b66 .. 0x00000b6f} = (0 .. 9);
@h{0x00000be6 .. 0x00000bef} = (0 .. 9);
@h{0x00000c66 .. 0x00000c6f} = (0 .. 9);
@h{0x00000ce6 .. 0x00000cef} = (0 .. 9);
@h{0x00000d66 .. 0x00000d6f} = (0 .. 9);
@h{0x00000e50 .. 0x00000e59} = (0 .. 9);
@h{0x00000ed0 .. 0x00000ed9} = (0 .. 9);
@h{0x00000f20 .. 0x00000f29} = (0 .. 9);
@h{0x00001040 .. 0x00001049} = (0 .. 9);
@h{0x000017e0 .. 0x000017e9} = (0 .. 9);
@h{0x00001810 .. 0x00001819} = (0 .. 9);
@h{0x00001946 .. 0x0000194f} = (0 .. 9);
@h{0x000019d0 .. 0x000019d9} = (0 .. 9);
@h{0x00001b50 .. 0x00001b59} = (0 .. 9);
@h{0x0000d830 .. 0x0000d839} = (0 .. 9);
@h{0x0000d870 .. 0x0000d879} = (0 .. 9);
@h{0x0000d8b0 .. 0x0000d8b9} = (0 .. 9);
@h{0x0000d8f0 .. 0x0000d8f9} = (0 .. 9);
@h{0x0000d930 .. 0x0000d939} = (0 .. 9);
@h{0x0000d970 .. 0x0000d979} = (0 .. 9);
@h{0x0000d9b0 .. 0x0000d9b9} = (0 .. 9);
@h{0x0000d9f0 .. 0x0000d9f9} = (0 .. 9);
@h{0x0000da30 .. 0x0000da39} = (0 .. 9);
@h{0x0000da70 .. 0x0000da79} = (0 .. 9);
@h{0x0000dab0 .. 0x0000dab9} = (0 .. 9);
@h{0x0000daf0 .. 0x0000daf9} = (0 .. 9);
@h{0x0000db30 .. 0x0000db39} = (0 .. 9);
@h{0x0000db70 .. 0x0000db79} = (0 .. 9);
@h{0x0000dbb0 .. 0x0000dbb9} = (0 .. 9);
@h{0x0000dbf0 .. 0x0000dbf9} = (0 .. 9);
@h{0x0000dc30 .. 0x0000dc39} = (0 .. 9);
@h{0x0000dc70 .. 0x0000dc79} = (0 .. 9);
@h{0x0000dcb0 .. 0x0000dcb9} = (0 .. 9);
@h{0x0000dcf0 .. 0x0000dcf9} = (0 .. 9);
@h{0x0000dd30 .. 0x0000dd39} = (0 .. 9);
@h{0x0000dd70 .. 0x0000dd79} = (0 .. 9);
@h{0x0000ddb0 .. 0x0000ddb9} = (0 .. 9);
@h{0x0000ddf0 .. 0x0000ddf9} = (0 .. 9);
@h{0x0000de30 .. 0x0000de39} = (0 .. 9);
@h{0x0000de70 .. 0x0000de79} = (0 .. 9);
@h{0x0000deb0 .. 0x0000deb9} = (0 .. 9);
@h{0x0000def0 .. 0x0000def9} = (0 .. 9);
@h{0x0000df30 .. 0x0000df39} = (0 .. 9);
@h{0x0000df70 .. 0x0000df79} = (0 .. 9);
@h{0x0000dfb0 .. 0x0000dfb9} = (0 .. 9);
@h{0x0000dff0 .. 0x0000dff9} = (0 .. 9);
@h{0x0000ff10 .. 0x0000ff19} = (0 .. 9);
@h{0x000104a0 .. 0x000104a9} = (0 .. 9);
@h{0x0001d7ce .. 0x0001d7ff} = (0 .. 9) x 5;
 
sub digits_to_int {
my $digits = shift;
my $int = '';
for my $digit (map ord, split //, $digits) {
$int .= $h{$digit};
}
return $int;
}
 
"this is not an interesting return value";

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.