mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-19 19:55:51 +00:00
- native support for k256
- improved entropy by taking advantage of platform crypto
- remove unnecessary sjcl overrides from sjcl-secp256k1.js
- updated ripple-lib curve instantiations to use k256
- add curve override so c256 points to k256
16dde36fa2
23 lines
540 B
Perl
Executable File
23 lines
540 B
Perl
Executable File
#!/usr/bin/env perl
|
|
|
|
# Convert numbers to hex, when doing so is likely to increase compressibility.
|
|
# This actually makes the script slightly longer, but generally makes it compress
|
|
# to something shorter.
|
|
#
|
|
# Here we're targeting constants like 0xFF, 0xFFFF0000, 0x10101, 0x100000000, etc.
|
|
|
|
sub digitize {
|
|
my $number = shift;
|
|
if ($number >= 256) {
|
|
my $nn = `printf "%x" $number`;
|
|
if ($nn =~ /^[01f]+$/i) { return "0x$nn"; }
|
|
}
|
|
return $number;
|
|
}
|
|
|
|
while (<>) {
|
|
s/([^a-zA-Z0-9_"])(\d+)/$1 . digitize $2/eg;
|
|
print;
|
|
}
|
|
|