locutus 2.0.32 → 2.0.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -0
- package/_data/rosetta.yml +325 -0
- package/awk/builtin/index.js +5 -0
- package/awk/builtin/int.js +13 -0
- package/awk/builtin/length.js +16 -0
- package/awk/builtin/substr.js +23 -0
- package/awk/builtin/tolower.js +11 -0
- package/awk/builtin/toupper.js +11 -0
- package/c/ctype/index.js +8 -0
- package/c/ctype/isalnum.js +15 -0
- package/c/ctype/isalpha.js +17 -0
- package/c/ctype/isdigit.js +15 -0
- package/c/ctype/islower.js +15 -0
- package/c/ctype/isspace.js +15 -0
- package/c/ctype/isupper.js +15 -0
- package/c/ctype/tolower.js +15 -0
- package/c/ctype/toupper.js +15 -0
- package/c/index.js +2 -5
- package/c/math/abs.js +14 -18
- package/c/math/frexp.js +19 -20
- package/c/math/index.js +2 -5
- package/c/stdio/index.js +1 -4
- package/c/stdio/sprintf.js +71 -81
- package/c/stdlib/atof.js +15 -0
- package/c/stdlib/atoi.js +17 -0
- package/c/stdlib/index.js +2 -0
- package/c/string/index.js +5 -0
- package/c/string/strcat.js +12 -0
- package/c/string/strchr.js +15 -0
- package/c/string/strcmp.js +21 -0
- package/c/string/strlen.js +12 -0
- package/c/string/strstr.js +15 -0
- package/clojure/Math/abs.js +13 -0
- package/clojure/Math/ceil.js +15 -0
- package/clojure/Math/floor.js +14 -0
- package/clojure/Math/index.js +3 -0
- package/elixir/Float/ceil.js +16 -0
- package/elixir/Float/floor.js +14 -0
- package/elixir/Float/index.js +2 -0
- package/elixir/Kernel/abs.js +13 -0
- package/elixir/Kernel/index.js +1 -0
- package/golang/index.js +1 -4
- package/golang/strconv/Atoi.js +26 -0
- package/golang/strconv/FormatBool.js +12 -0
- package/golang/strconv/FormatInt.js +21 -0
- package/golang/strconv/Itoa.js +14 -0
- package/golang/strconv/ParseBool.js +35 -0
- package/golang/strconv/ParseInt.js +27 -0
- package/golang/strconv/index.js +6 -0
- package/golang/strings/Compare.js +19 -0
- package/golang/strings/Contains.js +7 -9
- package/golang/strings/ContainsAny.js +18 -0
- package/golang/strings/Count.js +20 -22
- package/golang/strings/EqualFold.js +13 -0
- package/golang/strings/Fields.js +12 -0
- package/golang/strings/HasPrefix.js +15 -0
- package/golang/strings/HasSuffix.js +20 -0
- package/golang/strings/Index.js +11 -0
- package/golang/strings/Index2.js +9 -11
- package/golang/strings/IndexAny.js +18 -0
- package/golang/strings/Join.js +16 -0
- package/golang/strings/LastIndex.js +10 -12
- package/golang/strings/LastIndexAny.js +18 -0
- package/golang/strings/Repeat.js +19 -0
- package/golang/strings/Replace.js +44 -0
- package/golang/strings/Split.js +24 -0
- package/golang/strings/ToLower.js +9 -0
- package/golang/strings/ToUpper.js +9 -0
- package/golang/strings/Trim.js +19 -0
- package/golang/strings/TrimLeft.js +15 -0
- package/golang/strings/TrimPrefix.js +14 -0
- package/golang/strings/TrimRight.js +15 -0
- package/golang/strings/TrimSpace.js +10 -0
- package/golang/strings/TrimSuffix.js +14 -0
- package/golang/strings/index.js +25 -7
- package/index.js +5 -8
- package/julia/Base/abs.js +13 -0
- package/julia/Base/ceil.js +16 -0
- package/julia/Base/floor.js +14 -0
- package/julia/Base/index.js +3 -0
- package/lua/math/abs.js +13 -0
- package/lua/math/ceil.js +16 -0
- package/lua/math/floor.js +14 -0
- package/lua/math/index.js +3 -0
- package/lua/string/index.js +3 -0
- package/lua/string/lower.js +11 -0
- package/lua/string/sub.js +33 -0
- package/lua/string/upper.js +11 -0
- package/package.json +37 -51
- package/perl/POSIX/ceil.js +16 -0
- package/perl/POSIX/floor.js +14 -0
- package/perl/POSIX/index.js +2 -0
- package/perl/core/index.js +1 -0
- package/perl/core/length.js +16 -0
- package/php/_helpers/_bc.js +524 -515
- package/php/_helpers/_phpCastString.js +20 -25
- package/php/_helpers/_php_cast_float.js +5 -10
- package/php/_helpers/_php_cast_int.js +6 -11
- package/php/_helpers/index.js +4 -7
- package/php/array/array_change_key_case.js +11 -16
- package/php/array/array_chunk.js +20 -23
- package/php/array/array_column.js +22 -72
- package/php/array/array_combine.js +13 -18
- package/php/array/array_count_values.js +35 -39
- package/php/array/array_diff.js +11 -14
- package/php/array/array_diff_assoc.js +11 -14
- package/php/array/array_diff_key.js +11 -14
- package/php/array/array_diff_uassoc.js +15 -19
- package/php/array/array_diff_ukey.js +14 -17
- package/php/array/array_fill.js +11 -13
- package/php/array/array_fill_keys.js +5 -8
- package/php/array/array_filter.js +12 -13
- package/php/array/array_flip.js +13 -15
- package/php/array/array_intersect.js +13 -16
- package/php/array/array_intersect_assoc.js +13 -16
- package/php/array/array_intersect_key.js +15 -18
- package/php/array/array_intersect_uassoc.js +17 -20
- package/php/array/array_intersect_ukey.js +17 -20
- package/php/array/array_key_exists.js +4 -7
- package/php/array/array_keys.js +22 -24
- package/php/array/array_map.js +24 -29
- package/php/array/array_merge.js +22 -25
- package/php/array/array_merge_recursive.js +51 -27
- package/php/array/array_multisort.js +138 -130
- package/php/array/array_pad.js +24 -26
- package/php/array/array_pop.js +10 -13
- package/php/array/array_product.js +15 -17
- package/php/array/array_push.js +16 -19
- package/php/array/array_rand.js +11 -14
- package/php/array/array_reduce.js +11 -14
- package/php/array/array_replace.js +9 -12
- package/php/array/array_replace_recursive.js +20 -24
- package/php/array/array_reverse.js +12 -15
- package/php/array/array_search.js +27 -29
- package/php/array/array_shift.js +3 -6
- package/php/array/array_slice.js +37 -39
- package/php/array/array_splice.js +64 -69
- package/php/array/array_sum.js +7 -12
- package/php/array/array_udiff.js +14 -17
- package/php/array/array_udiff_assoc.js +14 -17
- package/php/array/array_udiff_uassoc.js +17 -20
- package/php/array/array_uintersect.js +16 -19
- package/php/array/array_uintersect_uassoc.js +18 -21
- package/php/array/array_unique.js +12 -15
- package/php/array/array_unshift.js +4 -7
- package/php/array/array_values.js +11 -13
- package/php/array/array_walk.js +10 -15
- package/php/array/array_walk_recursive.js +15 -20
- package/php/array/arsort.js +50 -52
- package/php/array/asort.js +50 -51
- package/php/array/count.js +15 -14
- package/php/array/current.js +30 -32
- package/php/array/each.js +32 -35
- package/php/array/end.js +27 -30
- package/php/array/in_array.js +7 -10
- package/php/array/index.js +73 -76
- package/php/array/key.js +32 -34
- package/php/array/krsort.js +50 -51
- package/php/array/ksort.js +50 -51
- package/php/array/natcasesort.js +37 -38
- package/php/array/natsort.js +35 -36
- package/php/array/next.js +34 -36
- package/php/array/pos.js +10 -12
- package/php/array/prev.js +32 -34
- package/php/array/range.js +30 -33
- package/php/array/reset.js +24 -27
- package/php/array/rsort.js +47 -49
- package/php/array/shuffle.js +16 -18
- package/php/array/sizeof.js +3 -6
- package/php/array/sort.js +43 -45
- package/php/array/uasort.js +19 -21
- package/php/array/uksort.js +22 -24
- package/php/array/usort.js +20 -22
- package/php/bc/bcadd.js +16 -19
- package/php/bc/bccomp.js +12 -15
- package/php/bc/bcdiv.js +17 -20
- package/php/bc/bcmul.js +16 -19
- package/php/bc/bcround.js +21 -24
- package/php/bc/bcscale.js +8 -11
- package/php/bc/bcsub.js +16 -19
- package/php/bc/index.js +7 -10
- package/php/ctype/ctype_alnum.js +14 -16
- package/php/ctype/ctype_alpha.js +14 -16
- package/php/ctype/ctype_cntrl.js +9 -12
- package/php/ctype/ctype_digit.js +14 -16
- package/php/ctype/ctype_graph.js +14 -16
- package/php/ctype/ctype_lower.js +14 -16
- package/php/ctype/ctype_print.js +14 -16
- package/php/ctype/ctype_punct.js +14 -16
- package/php/ctype/ctype_space.js +9 -12
- package/php/ctype/ctype_upper.js +14 -16
- package/php/ctype/ctype_xdigit.js +14 -16
- package/php/ctype/index.js +11 -14
- package/php/datetime/checkdate.js +15 -17
- package/php/datetime/date.js +142 -123
- package/php/datetime/date_parse.js +18 -21
- package/php/datetime/getdate.js +38 -24
- package/php/datetime/gettimeofday.js +7 -10
- package/php/datetime/gmdate.js +17 -16
- package/php/datetime/gmmktime.js +23 -25
- package/php/datetime/gmstrftime.js +17 -14
- package/php/datetime/idate.js +44 -38
- package/php/datetime/index.js +15 -18
- package/php/datetime/microtime.js +11 -14
- package/php/datetime/mktime.js +14 -17
- package/php/datetime/strftime.js +122 -113
- package/php/datetime/strptime.js +210 -191
- package/php/datetime/strtotime.js +615 -496
- package/php/datetime/time.js +11 -13
- package/php/exec/escapeshellarg.js +16 -18
- package/php/exec/index.js +1 -4
- package/php/filesystem/basename.js +22 -24
- package/php/filesystem/dirname.js +12 -14
- package/php/filesystem/file_exists.js +9 -11
- package/php/filesystem/file_get_contents.js +3 -6
- package/php/filesystem/index.js +6 -9
- package/php/filesystem/pathinfo.js +47 -46
- package/php/filesystem/realpath.js +16 -19
- package/php/funchand/call_user_func.js +4 -7
- package/php/funchand/call_user_func_array.js +19 -22
- package/php/funchand/create_function.js +4 -7
- package/php/funchand/function_exists.js +4 -8
- package/php/funchand/get_defined_functions.js +25 -32
- package/php/funchand/index.js +5 -8
- package/php/i18n/i18n_loc_get_default.js +7 -10
- package/php/i18n/i18n_loc_set_default.js +12 -15
- package/php/i18n/index.js +2 -5
- package/php/index.js +20 -23
- package/php/info/assert_options.js +25 -27
- package/php/info/getenv.js +8 -10
- package/php/info/index.js +6 -9
- package/php/info/ini_get.js +9 -12
- package/php/info/ini_set.js +32 -34
- package/php/info/set_time_limit.js +8 -11
- package/php/info/version_compare.js +43 -44
- package/php/json/index.js +3 -6
- package/php/json/json_decode.js +42 -28
- package/php/json/json_encode.js +89 -66
- package/php/json/json_last_error.js +11 -13
- package/php/math/abs.js +2 -5
- package/php/math/acos.js +2 -5
- package/php/math/acosh.js +7 -9
- package/php/math/asin.js +2 -5
- package/php/math/asinh.js +7 -9
- package/php/math/atan.js +7 -9
- package/php/math/atan2.js +7 -9
- package/php/math/atanh.js +2 -5
- package/php/math/base_convert.js +8 -10
- package/php/math/bindec.js +12 -14
- package/php/math/ceil.js +7 -9
- package/php/math/cos.js +7 -9
- package/php/math/cosh.js +7 -9
- package/php/math/decbin.js +16 -18
- package/php/math/dechex.js +3 -6
- package/php/math/decoct.js +13 -15
- package/php/math/deg2rad.js +8 -10
- package/php/math/exp.js +7 -9
- package/php/math/expm1.js +9 -11
- package/php/math/floor.js +7 -9
- package/php/math/fmod.js +27 -29
- package/php/math/getrandmax.js +7 -9
- package/php/math/hexdec.js +10 -12
- package/php/math/hypot.js +8 -11
- package/php/math/index.js +46 -49
- package/php/math/is_finite.js +9 -14
- package/php/math/is_infinite.js +9 -14
- package/php/math/is_nan.js +8 -13
- package/php/math/lcg_value.js +8 -10
- package/php/math/log.js +8 -10
- package/php/math/log10.js +12 -14
- package/php/math/log1p.js +15 -17
- package/php/math/max.js +54 -59
- package/php/math/min.js +54 -59
- package/php/math/mt_getrandmax.js +7 -9
- package/php/math/mt_rand.js +15 -17
- package/php/math/octdec.js +8 -10
- package/php/math/pi.js +2 -5
- package/php/math/pow.js +2 -5
- package/php/math/rad2deg.js +8 -10
- package/php/math/rand.js +15 -17
- package/php/math/round.js +48 -49
- package/php/math/sin.js +7 -9
- package/php/math/sinh.js +7 -9
- package/php/math/sqrt.js +7 -9
- package/php/math/tan.js +7 -9
- package/php/math/tanh.js +8 -10
- package/php/misc/index.js +2 -5
- package/php/misc/pack.js +173 -165
- package/php/misc/uniqid.js +20 -23
- package/php/net-gopher/gopher_parsedir.js +27 -29
- package/php/net-gopher/index.js +1 -4
- package/php/network/index.js +6 -9
- package/php/network/inet_ntop.js +15 -15
- package/php/network/inet_pton.js +30 -34
- package/php/network/ip2long.js +25 -15
- package/php/network/long2ip.js +8 -10
- package/php/network/setcookie.js +11 -13
- package/php/network/setrawcookie.js +16 -19
- package/php/pcre/index.js +4 -7
- package/php/pcre/preg_match.js +3 -6
- package/php/pcre/preg_quote.js +2 -5
- package/php/pcre/preg_replace.js +8 -11
- package/php/pcre/sql_regcase.js +17 -20
- package/php/strings/addcslashes.js +86 -88
- package/php/strings/addslashes.js +15 -16
- package/php/strings/bin2hex.js +19 -43
- package/php/strings/chop.js +8 -10
- package/php/strings/chr.js +12 -14
- package/php/strings/chunk_split.js +15 -17
- package/php/strings/convert_cyr_string.js +137 -50
- package/php/strings/convert_uuencode.js +35 -38
- package/php/strings/count_chars.js +29 -27
- package/php/strings/crc32.js +276 -21
- package/php/strings/echo.js +28 -30
- package/php/strings/explode.js +31 -26
- package/php/strings/get_html_translation_table.js +123 -122
- package/php/strings/hex2bin.js +21 -21
- package/php/strings/html_entity_decode.js +31 -33
- package/php/strings/htmlentities.js +38 -34
- package/php/strings/htmlspecialchars.js +20 -23
- package/php/strings/htmlspecialchars_decode.js +19 -21
- package/php/strings/implode.js +23 -27
- package/php/strings/index.js +91 -94
- package/php/strings/join.js +8 -10
- package/php/strings/lcfirst.js +9 -11
- package/php/strings/levenshtein.js +37 -39
- package/php/strings/localeconv.js +12 -15
- package/php/strings/ltrim.js +12 -14
- package/php/strings/md5.js +216 -223
- package/php/strings/md5_file.js +17 -19
- package/php/strings/metaphone.js +112 -117
- package/php/strings/money_format.js +139 -126
- package/php/strings/nl2br.js +24 -26
- package/php/strings/nl_langinfo.js +32 -35
- package/php/strings/number_format.js +19 -22
- package/php/strings/ord.js +19 -21
- package/php/strings/parse_str.js +53 -56
- package/php/strings/printf.js +6 -9
- package/php/strings/quoted_printable_decode.js +7 -10
- package/php/strings/quoted_printable_encode.js +19 -20
- package/php/strings/quotemeta.js +7 -9
- package/php/strings/rtrim.js +14 -16
- package/php/strings/setlocale.js +148 -104
- package/php/strings/sha1.js +108 -106
- package/php/strings/sha1_file.js +15 -17
- package/php/strings/similar_text.js +34 -33
- package/php/strings/soundex.js +34 -36
- package/php/strings/split.js +8 -10
- package/php/strings/sprintf.js +112 -114
- package/php/strings/sscanf.js +99 -96
- package/php/strings/str_getcsv.js +37 -32
- package/php/strings/str_ireplace.js +50 -55
- package/php/strings/str_pad.js +18 -21
- package/php/strings/str_repeat.js +14 -16
- package/php/strings/str_replace.js +32 -37
- package/php/strings/str_rot13.js +15 -17
- package/php/strings/str_shuffle.js +12 -15
- package/php/strings/str_split.js +19 -21
- package/php/strings/str_word_count.js +51 -50
- package/php/strings/strcasecmp.js +12 -14
- package/php/strings/strchr.js +10 -12
- package/php/strings/strcmp.js +12 -14
- package/php/strings/strcoll.js +9 -12
- package/php/strings/strcspn.js +30 -25
- package/php/strings/strip_tags.js +50 -52
- package/php/strings/stripos.js +12 -14
- package/php/strings/stripslashes.js +8 -10
- package/php/strings/stristr.js +15 -17
- package/php/strings/strlen.js +23 -26
- package/php/strings/strnatcasecmp.js +6 -8
- package/php/strings/strnatcmp.js +47 -46
- package/php/strings/strncasecmp.js +30 -32
- package/php/strings/strncmp.js +5 -7
- package/php/strings/strpbrk.js +12 -14
- package/php/strings/strpos.js +11 -13
- package/php/strings/strrchr.js +7 -10
- package/php/strings/strrev.js +188 -10
- package/php/strings/strripos.js +16 -18
- package/php/strings/strrpos.js +20 -22
- package/php/strings/strspn.js +24 -26
- package/php/strings/strstr.js +20 -22
- package/php/strings/strtok.js +14 -16
- package/php/strings/strtolower.js +8 -10
- package/php/strings/strtoupper.js +8 -10
- package/php/strings/strtr.js +38 -43
- package/php/strings/substr.js +14 -18
- package/php/strings/substr_compare.js +18 -20
- package/php/strings/substr_count.js +11 -14
- package/php/strings/substr_replace.js +5 -8
- package/php/strings/trim.js +53 -32
- package/php/strings/ucfirst.js +11 -13
- package/php/strings/ucwords.js +3 -6
- package/php/strings/vprintf.js +6 -9
- package/php/strings/vsprintf.js +8 -10
- package/php/strings/wordwrap.js +32 -35
- package/php/url/base64_decode.js +42 -40
- package/php/url/base64_encode.js +51 -53
- package/php/url/http_build_query.js +27 -32
- package/php/url/index.js +8 -11
- package/php/url/parse_url.js +61 -25
- package/php/url/rawurldecode.js +8 -8
- package/php/url/rawurlencode.js +9 -6
- package/php/url/urldecode.js +9 -8
- package/php/url/urlencode.js +11 -6
- package/php/var/boolval.js +31 -33
- package/php/var/doubleval.js +10 -12
- package/php/var/empty.js +11 -16
- package/php/var/floatval.js +13 -15
- package/php/var/gettype.js +22 -23
- package/php/var/index.js +30 -33
- package/php/var/intval.js +35 -39
- package/php/var/is_array.js +27 -31
- package/php/var/is_binary.js +2 -5
- package/php/var/is_bool.js +10 -12
- package/php/var/is_buffer.js +2 -5
- package/php/var/is_callable.js +34 -35
- package/php/var/is_double.js +10 -12
- package/php/var/is_float.js +12 -14
- package/php/var/is_int.js +20 -22
- package/php/var/is_integer.js +12 -14
- package/php/var/is_long.js +3 -6
- package/php/var/is_null.js +9 -11
- package/php/var/is_numeric.js +30 -6
- package/php/var/is_object.js +4 -9
- package/php/var/is_real.js +3 -6
- package/php/var/is_scalar.js +2 -8
- package/php/var/is_string.js +9 -11
- package/php/var/is_unicode.js +12 -15
- package/php/var/isset.js +9 -12
- package/php/var/print_r.js +49 -53
- package/php/var/serialize.js +47 -52
- package/php/var/serialize.vitest.ts +10 -0
- package/php/var/strval.js +10 -13
- package/php/var/unserialize.js +168 -202
- package/php/var/var_dump.js +105 -104
- package/php/var/var_export.js +64 -66
- package/php/xdiff/index.js +2 -5
- package/php/xdiff/xdiff_string_diff.js +240 -226
- package/php/xdiff/xdiff_string_patch.js +98 -93
- package/php/xml/index.js +2 -5
- package/php/xml/utf8_decode.js +40 -42
- package/php/xml/utf8_encode.js +40 -42
- package/python/index.js +1 -4
- package/python/math/ceil.js +17 -0
- package/python/math/exp.js +12 -0
- package/python/math/fabs.js +14 -0
- package/python/math/factorial.js +29 -0
- package/python/math/floor.js +14 -0
- package/python/math/gcd.js +23 -0
- package/python/math/index.js +15 -0
- package/python/math/isfinite.js +14 -0
- package/python/math/isinf.js +14 -0
- package/python/math/isnan.js +14 -0
- package/python/math/log.js +16 -0
- package/python/math/log10.js +14 -0
- package/python/math/log2.js +14 -0
- package/python/math/pow.js +14 -0
- package/python/math/sqrt.js +14 -0
- package/python/math/trunc.js +14 -0
- package/python/string/ascii_letters.js +14 -14
- package/python/string/ascii_lowercase.js +12 -16
- package/python/string/ascii_uppercase.js +12 -16
- package/python/string/capwords.js +4 -7
- package/python/string/digits.js +10 -0
- package/python/string/hexdigits.js +10 -0
- package/python/string/index.js +10 -8
- package/python/string/octdigits.js +10 -0
- package/python/string/printable.js +15 -0
- package/python/string/punctuation.js +5 -7
- package/python/string/whitespace.js +10 -0
- package/r/base/abs.js +13 -0
- package/r/base/ceiling.js +16 -0
- package/r/base/floor.js +14 -0
- package/r/base/index.js +3 -0
- package/ruby/Array/compact.js +18 -0
- package/ruby/Array/first.js +22 -0
- package/ruby/Array/flatten.js +22 -0
- package/ruby/Array/index.js +6 -0
- package/ruby/Array/last.js +22 -0
- package/ruby/Array/sample.js +31 -0
- package/ruby/Array/uniq.js +16 -0
- package/ruby/Math/acos.js +2 -5
- package/ruby/Math/asin.js +11 -0
- package/ruby/Math/atan.js +11 -0
- package/ruby/Math/cbrt.js +13 -0
- package/ruby/Math/cos.js +12 -0
- package/ruby/Math/cosh.js +11 -0
- package/ruby/Math/exp.js +11 -0
- package/ruby/Math/index.js +15 -4
- package/ruby/Math/log.js +11 -0
- package/ruby/Math/log10.js +13 -0
- package/ruby/Math/log2.js +13 -0
- package/ruby/Math/sin.js +12 -0
- package/ruby/Math/sinh.js +11 -0
- package/ruby/Math/sqrt.js +13 -0
- package/ruby/Math/tan.js +11 -0
- package/ruby/Math/tanh.js +11 -0
- package/ruby/String/capitalize.js +19 -0
- package/ruby/String/chomp.js +27 -0
- package/ruby/String/chop.js +25 -0
- package/ruby/String/downcase.js +10 -0
- package/ruby/String/end_with.js +17 -0
- package/ruby/String/include.js +12 -0
- package/ruby/String/index.js +11 -0
- package/ruby/String/length.js +12 -0
- package/ruby/String/reverse.js +12 -0
- package/ruby/String/start_with.js +14 -0
- package/ruby/String/strip.js +12 -0
- package/ruby/String/upcase.js +10 -0
- package/ruby/index.js +1 -4
- package/_util/cli.js +0 -14
- package/_util/cli.js.map +0 -1
- package/_util/util.js +0 -620
- package/_util/util.js.map +0 -1
- package/c/index.js.map +0 -1
- package/c/math/abs.js.map +0 -1
- package/c/math/frexp.js.map +0 -1
- package/c/math/index.js.map +0 -1
- package/c/stdio/index.js.map +0 -1
- package/c/stdio/sprintf.js.map +0 -1
- package/golang/index.js.map +0 -1
- package/golang/strings/Contains.js.map +0 -1
- package/golang/strings/Count.js.map +0 -1
- package/golang/strings/Index2.js.map +0 -1
- package/golang/strings/LastIndex.js.map +0 -1
- package/golang/strings/index.js.map +0 -1
- package/index.js.map +0 -1
- package/php/_helpers/_bc.js.map +0 -1
- package/php/_helpers/_phpCastString.js.map +0 -1
- package/php/_helpers/_php_cast_float.js.map +0 -1
- package/php/_helpers/_php_cast_int.js.map +0 -1
- package/php/_helpers/index.js.map +0 -1
- package/php/array/array_change_key_case.js.map +0 -1
- package/php/array/array_chunk.js.map +0 -1
- package/php/array/array_column.js.map +0 -1
- package/php/array/array_combine.js.map +0 -1
- package/php/array/array_count_values.js.map +0 -1
- package/php/array/array_diff.js.map +0 -1
- package/php/array/array_diff_assoc.js.map +0 -1
- package/php/array/array_diff_key.js.map +0 -1
- package/php/array/array_diff_uassoc.js.map +0 -1
- package/php/array/array_diff_ukey.js.map +0 -1
- package/php/array/array_fill.js.map +0 -1
- package/php/array/array_fill_keys.js.map +0 -1
- package/php/array/array_filter.js.map +0 -1
- package/php/array/array_flip.js.map +0 -1
- package/php/array/array_intersect.js.map +0 -1
- package/php/array/array_intersect_assoc.js.map +0 -1
- package/php/array/array_intersect_key.js.map +0 -1
- package/php/array/array_intersect_uassoc.js.map +0 -1
- package/php/array/array_intersect_ukey.js.map +0 -1
- package/php/array/array_key_exists.js.map +0 -1
- package/php/array/array_keys.js.map +0 -1
- package/php/array/array_map.js.map +0 -1
- package/php/array/array_merge.js.map +0 -1
- package/php/array/array_merge_recursive.js.map +0 -1
- package/php/array/array_multisort.js.map +0 -1
- package/php/array/array_pad.js.map +0 -1
- package/php/array/array_pop.js.map +0 -1
- package/php/array/array_product.js.map +0 -1
- package/php/array/array_push.js.map +0 -1
- package/php/array/array_rand.js.map +0 -1
- package/php/array/array_reduce.js.map +0 -1
- package/php/array/array_replace.js.map +0 -1
- package/php/array/array_replace_recursive.js.map +0 -1
- package/php/array/array_reverse.js.map +0 -1
- package/php/array/array_search.js.map +0 -1
- package/php/array/array_shift.js.map +0 -1
- package/php/array/array_slice.js.map +0 -1
- package/php/array/array_splice.js.map +0 -1
- package/php/array/array_sum.js.map +0 -1
- package/php/array/array_udiff.js.map +0 -1
- package/php/array/array_udiff_assoc.js.map +0 -1
- package/php/array/array_udiff_uassoc.js.map +0 -1
- package/php/array/array_uintersect.js.map +0 -1
- package/php/array/array_uintersect_uassoc.js.map +0 -1
- package/php/array/array_unique.js.map +0 -1
- package/php/array/array_unshift.js.map +0 -1
- package/php/array/array_values.js.map +0 -1
- package/php/array/array_walk.js.map +0 -1
- package/php/array/array_walk_recursive.js.map +0 -1
- package/php/array/arsort.js.map +0 -1
- package/php/array/asort.js.map +0 -1
- package/php/array/count.js.map +0 -1
- package/php/array/current.js.map +0 -1
- package/php/array/each.js.map +0 -1
- package/php/array/end.js.map +0 -1
- package/php/array/in_array.js.map +0 -1
- package/php/array/index.js.map +0 -1
- package/php/array/key.js.map +0 -1
- package/php/array/krsort.js.map +0 -1
- package/php/array/ksort.js.map +0 -1
- package/php/array/natcasesort.js.map +0 -1
- package/php/array/natsort.js.map +0 -1
- package/php/array/next.js.map +0 -1
- package/php/array/pos.js.map +0 -1
- package/php/array/prev.js.map +0 -1
- package/php/array/range.js.map +0 -1
- package/php/array/reset.js.map +0 -1
- package/php/array/rsort.js.map +0 -1
- package/php/array/shuffle.js.map +0 -1
- package/php/array/sizeof.js.map +0 -1
- package/php/array/sort.js.map +0 -1
- package/php/array/uasort.js.map +0 -1
- package/php/array/uksort.js.map +0 -1
- package/php/array/usort.js.map +0 -1
- package/php/bc/bcadd.js.map +0 -1
- package/php/bc/bccomp.js.map +0 -1
- package/php/bc/bcdiv.js.map +0 -1
- package/php/bc/bcmul.js.map +0 -1
- package/php/bc/bcround.js.map +0 -1
- package/php/bc/bcscale.js.map +0 -1
- package/php/bc/bcsub.js.map +0 -1
- package/php/bc/index.js.map +0 -1
- package/php/ctype/ctype_alnum.js.map +0 -1
- package/php/ctype/ctype_alpha.js.map +0 -1
- package/php/ctype/ctype_cntrl.js.map +0 -1
- package/php/ctype/ctype_digit.js.map +0 -1
- package/php/ctype/ctype_graph.js.map +0 -1
- package/php/ctype/ctype_lower.js.map +0 -1
- package/php/ctype/ctype_print.js.map +0 -1
- package/php/ctype/ctype_punct.js.map +0 -1
- package/php/ctype/ctype_space.js.map +0 -1
- package/php/ctype/ctype_upper.js.map +0 -1
- package/php/ctype/ctype_xdigit.js.map +0 -1
- package/php/ctype/index.js.map +0 -1
- package/php/datetime/checkdate.js.map +0 -1
- package/php/datetime/date.js.map +0 -1
- package/php/datetime/date_parse.js.map +0 -1
- package/php/datetime/getdate.js.map +0 -1
- package/php/datetime/gettimeofday.js.map +0 -1
- package/php/datetime/gmdate.js.map +0 -1
- package/php/datetime/gmmktime.js.map +0 -1
- package/php/datetime/gmstrftime.js.map +0 -1
- package/php/datetime/idate.js.map +0 -1
- package/php/datetime/index.js.map +0 -1
- package/php/datetime/microtime.js.map +0 -1
- package/php/datetime/mktime.js.map +0 -1
- package/php/datetime/strftime.js.map +0 -1
- package/php/datetime/strptime.js.map +0 -1
- package/php/datetime/strtotime.js.map +0 -1
- package/php/datetime/time.js.map +0 -1
- package/php/exec/escapeshellarg.js.map +0 -1
- package/php/exec/index.js.map +0 -1
- package/php/filesystem/basename.js.map +0 -1
- package/php/filesystem/dirname.js.map +0 -1
- package/php/filesystem/file_exists.js.map +0 -1
- package/php/filesystem/file_get_contents.js.map +0 -1
- package/php/filesystem/index.js.map +0 -1
- package/php/filesystem/pathinfo.js.map +0 -1
- package/php/filesystem/realpath.js.map +0 -1
- package/php/funchand/call_user_func.js.map +0 -1
- package/php/funchand/call_user_func_array.js.map +0 -1
- package/php/funchand/create_function.js.map +0 -1
- package/php/funchand/function_exists.js.map +0 -1
- package/php/funchand/get_defined_functions.js.map +0 -1
- package/php/funchand/index.js.map +0 -1
- package/php/i18n/i18n_loc_get_default.js.map +0 -1
- package/php/i18n/i18n_loc_set_default.js.map +0 -1
- package/php/i18n/index.js.map +0 -1
- package/php/index.js.map +0 -1
- package/php/info/assert_options.js.map +0 -1
- package/php/info/getenv.js.map +0 -1
- package/php/info/index.js.map +0 -1
- package/php/info/ini_get.js.map +0 -1
- package/php/info/ini_set.js.map +0 -1
- package/php/info/set_time_limit.js.map +0 -1
- package/php/info/version_compare.js.map +0 -1
- package/php/json/index.js.map +0 -1
- package/php/json/json_decode.js.map +0 -1
- package/php/json/json_encode.js.map +0 -1
- package/php/json/json_last_error.js.map +0 -1
- package/php/math/abs.js.map +0 -1
- package/php/math/acos.js.map +0 -1
- package/php/math/acosh.js.map +0 -1
- package/php/math/asin.js.map +0 -1
- package/php/math/asinh.js.map +0 -1
- package/php/math/atan.js.map +0 -1
- package/php/math/atan2.js.map +0 -1
- package/php/math/atanh.js.map +0 -1
- package/php/math/base_convert.js.map +0 -1
- package/php/math/bindec.js.map +0 -1
- package/php/math/ceil.js.map +0 -1
- package/php/math/cos.js.map +0 -1
- package/php/math/cosh.js.map +0 -1
- package/php/math/decbin.js.map +0 -1
- package/php/math/dechex.js.map +0 -1
- package/php/math/decoct.js.map +0 -1
- package/php/math/deg2rad.js.map +0 -1
- package/php/math/exp.js.map +0 -1
- package/php/math/expm1.js.map +0 -1
- package/php/math/floor.js.map +0 -1
- package/php/math/fmod.js.map +0 -1
- package/php/math/getrandmax.js.map +0 -1
- package/php/math/hexdec.js.map +0 -1
- package/php/math/hypot.js.map +0 -1
- package/php/math/index.js.map +0 -1
- package/php/math/is_finite.js.map +0 -1
- package/php/math/is_infinite.js.map +0 -1
- package/php/math/is_nan.js.map +0 -1
- package/php/math/lcg_value.js.map +0 -1
- package/php/math/log.js.map +0 -1
- package/php/math/log10.js.map +0 -1
- package/php/math/log1p.js.map +0 -1
- package/php/math/max.js.map +0 -1
- package/php/math/min.js.map +0 -1
- package/php/math/mt_getrandmax.js.map +0 -1
- package/php/math/mt_rand.js.map +0 -1
- package/php/math/octdec.js.map +0 -1
- package/php/math/pi.js.map +0 -1
- package/php/math/pow.js.map +0 -1
- package/php/math/rad2deg.js.map +0 -1
- package/php/math/rand.js.map +0 -1
- package/php/math/round.js.map +0 -1
- package/php/math/sin.js.map +0 -1
- package/php/math/sinh.js.map +0 -1
- package/php/math/sqrt.js.map +0 -1
- package/php/math/tan.js.map +0 -1
- package/php/math/tanh.js.map +0 -1
- package/php/misc/index.js.map +0 -1
- package/php/misc/pack.js.map +0 -1
- package/php/misc/uniqid.js.map +0 -1
- package/php/net-gopher/gopher_parsedir.js.map +0 -1
- package/php/net-gopher/index.js.map +0 -1
- package/php/network/index.js.map +0 -1
- package/php/network/inet_ntop.js.map +0 -1
- package/php/network/inet_pton.js.map +0 -1
- package/php/network/ip2long.js.map +0 -1
- package/php/network/long2ip.js.map +0 -1
- package/php/network/setcookie.js.map +0 -1
- package/php/network/setrawcookie.js.map +0 -1
- package/php/pcre/index.js.map +0 -1
- package/php/pcre/preg_match.js.map +0 -1
- package/php/pcre/preg_quote.js.map +0 -1
- package/php/pcre/preg_replace.js.map +0 -1
- package/php/pcre/sql_regcase.js.map +0 -1
- package/php/strings/addcslashes.js.map +0 -1
- package/php/strings/addslashes.js.map +0 -1
- package/php/strings/bin2hex.js.map +0 -1
- package/php/strings/chop.js.map +0 -1
- package/php/strings/chr.js.map +0 -1
- package/php/strings/chunk_split.js.map +0 -1
- package/php/strings/convert_cyr_string.js.map +0 -1
- package/php/strings/convert_uuencode.js.map +0 -1
- package/php/strings/count_chars.js.map +0 -1
- package/php/strings/crc32.js.map +0 -1
- package/php/strings/echo.js.map +0 -1
- package/php/strings/explode.js.map +0 -1
- package/php/strings/get_html_translation_table.js.map +0 -1
- package/php/strings/hex2bin.js.map +0 -1
- package/php/strings/html_entity_decode.js.map +0 -1
- package/php/strings/htmlentities.js.map +0 -1
- package/php/strings/htmlspecialchars.js.map +0 -1
- package/php/strings/htmlspecialchars_decode.js.map +0 -1
- package/php/strings/implode.js.map +0 -1
- package/php/strings/index.js.map +0 -1
- package/php/strings/join.js.map +0 -1
- package/php/strings/lcfirst.js.map +0 -1
- package/php/strings/levenshtein.js.map +0 -1
- package/php/strings/localeconv.js.map +0 -1
- package/php/strings/ltrim.js.map +0 -1
- package/php/strings/md5.js.map +0 -1
- package/php/strings/md5_file.js.map +0 -1
- package/php/strings/metaphone.js.map +0 -1
- package/php/strings/money_format.js.map +0 -1
- package/php/strings/nl2br.js.map +0 -1
- package/php/strings/nl_langinfo.js.map +0 -1
- package/php/strings/number_format.js.map +0 -1
- package/php/strings/ord.js.map +0 -1
- package/php/strings/parse_str.js.map +0 -1
- package/php/strings/printf.js.map +0 -1
- package/php/strings/quoted_printable_decode.js.map +0 -1
- package/php/strings/quoted_printable_encode.js.map +0 -1
- package/php/strings/quotemeta.js.map +0 -1
- package/php/strings/rtrim.js.map +0 -1
- package/php/strings/setlocale.js.map +0 -1
- package/php/strings/sha1.js.map +0 -1
- package/php/strings/sha1_file.js.map +0 -1
- package/php/strings/similar_text.js.map +0 -1
- package/php/strings/soundex.js.map +0 -1
- package/php/strings/split.js.map +0 -1
- package/php/strings/sprintf.js.map +0 -1
- package/php/strings/sscanf.js.map +0 -1
- package/php/strings/str_getcsv.js.map +0 -1
- package/php/strings/str_ireplace.js.map +0 -1
- package/php/strings/str_pad.js.map +0 -1
- package/php/strings/str_repeat.js.map +0 -1
- package/php/strings/str_replace.js.map +0 -1
- package/php/strings/str_rot13.js.map +0 -1
- package/php/strings/str_shuffle.js.map +0 -1
- package/php/strings/str_split.js.map +0 -1
- package/php/strings/str_word_count.js.map +0 -1
- package/php/strings/strcasecmp.js.map +0 -1
- package/php/strings/strchr.js.map +0 -1
- package/php/strings/strcmp.js.map +0 -1
- package/php/strings/strcoll.js.map +0 -1
- package/php/strings/strcspn.js.map +0 -1
- package/php/strings/strip_tags.js.map +0 -1
- package/php/strings/stripos.js.map +0 -1
- package/php/strings/stripslashes.js.map +0 -1
- package/php/strings/stristr.js.map +0 -1
- package/php/strings/strlen.js.map +0 -1
- package/php/strings/strnatcasecmp.js.map +0 -1
- package/php/strings/strnatcmp.js.map +0 -1
- package/php/strings/strncasecmp.js.map +0 -1
- package/php/strings/strncmp.js.map +0 -1
- package/php/strings/strpbrk.js.map +0 -1
- package/php/strings/strpos.js.map +0 -1
- package/php/strings/strrchr.js.map +0 -1
- package/php/strings/strrev.js.map +0 -1
- package/php/strings/strripos.js.map +0 -1
- package/php/strings/strrpos.js.map +0 -1
- package/php/strings/strspn.js.map +0 -1
- package/php/strings/strstr.js.map +0 -1
- package/php/strings/strtok.js.map +0 -1
- package/php/strings/strtolower.js.map +0 -1
- package/php/strings/strtoupper.js.map +0 -1
- package/php/strings/strtr.js.map +0 -1
- package/php/strings/substr.js.map +0 -1
- package/php/strings/substr_compare.js.map +0 -1
- package/php/strings/substr_count.js.map +0 -1
- package/php/strings/substr_replace.js.map +0 -1
- package/php/strings/trim.js.map +0 -1
- package/php/strings/ucfirst.js.map +0 -1
- package/php/strings/ucwords.js.map +0 -1
- package/php/strings/vprintf.js.map +0 -1
- package/php/strings/vsprintf.js.map +0 -1
- package/php/strings/wordwrap.js.map +0 -1
- package/php/url/base64_decode.js.map +0 -1
- package/php/url/base64_encode.js.map +0 -1
- package/php/url/http_build_query.js.map +0 -1
- package/php/url/index.js.map +0 -1
- package/php/url/parse_url.js.map +0 -1
- package/php/url/rawurldecode.js.map +0 -1
- package/php/url/rawurlencode.js.map +0 -1
- package/php/url/urldecode.js.map +0 -1
- package/php/url/urlencode.js.map +0 -1
- package/php/var/boolval.js.map +0 -1
- package/php/var/doubleval.js.map +0 -1
- package/php/var/empty.js.map +0 -1
- package/php/var/floatval.js.map +0 -1
- package/php/var/gettype.js.map +0 -1
- package/php/var/index.js.map +0 -1
- package/php/var/intval.js.map +0 -1
- package/php/var/is_array.js.map +0 -1
- package/php/var/is_binary.js.map +0 -1
- package/php/var/is_bool.js.map +0 -1
- package/php/var/is_buffer.js.map +0 -1
- package/php/var/is_callable.js.map +0 -1
- package/php/var/is_double.js.map +0 -1
- package/php/var/is_float.js.map +0 -1
- package/php/var/is_int.js.map +0 -1
- package/php/var/is_integer.js.map +0 -1
- package/php/var/is_long.js.map +0 -1
- package/php/var/is_null.js.map +0 -1
- package/php/var/is_numeric.js.map +0 -1
- package/php/var/is_object.js.map +0 -1
- package/php/var/is_real.js.map +0 -1
- package/php/var/is_scalar.js.map +0 -1
- package/php/var/is_string.js.map +0 -1
- package/php/var/is_unicode.js.map +0 -1
- package/php/var/isset.js.map +0 -1
- package/php/var/print_r.js.map +0 -1
- package/php/var/serialize.js.map +0 -1
- package/php/var/serialize.mocha.js +0 -14
- package/php/var/serialize.mocha.js.map +0 -1
- package/php/var/strval.js.map +0 -1
- package/php/var/unserialize.js.map +0 -1
- package/php/var/var_dump.js.map +0 -1
- package/php/var/var_export.js.map +0 -1
- package/php/xdiff/index.js.map +0 -1
- package/php/xdiff/xdiff_string_diff.js.map +0 -1
- package/php/xdiff/xdiff_string_patch.js.map +0 -1
- package/php/xml/index.js.map +0 -1
- package/php/xml/utf8_decode.js.map +0 -1
- package/php/xml/utf8_encode.js.map +0 -1
- package/python/index.js.map +0 -1
- package/python/string/ascii_letters.js.map +0 -1
- package/python/string/ascii_lowercase.js.map +0 -1
- package/python/string/ascii_uppercase.js.map +0 -1
- package/python/string/capwords.js.map +0 -1
- package/python/string/index.js.map +0 -1
- package/python/string/punctuation.js.map +0 -1
- package/ruby/Math/acos.js.map +0 -1
- package/ruby/Math/index.js.map +0 -1
- package/ruby/index.js.map +0 -1
package/php/strings/setlocale.js
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
|
4
|
-
|
|
5
1
|
module.exports = function setlocale(category, locale) {
|
|
6
2
|
// discuss at: https://locutus.io/php/setlocale/
|
|
7
3
|
// original by: Brett Zamir (https://brett-zamir.me)
|
|
@@ -17,28 +13,28 @@ module.exports = function setlocale(category, locale) {
|
|
|
17
13
|
// example 1: setlocale('LC_ALL', 'en_US')
|
|
18
14
|
// returns 1: 'en_US'
|
|
19
15
|
|
|
20
|
-
|
|
16
|
+
const getenv = require('../info/getenv')
|
|
21
17
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
let categ = ''
|
|
19
|
+
const cats = []
|
|
20
|
+
let i = 0
|
|
25
21
|
|
|
26
|
-
|
|
22
|
+
const _copy = function _copy(orig) {
|
|
27
23
|
if (orig instanceof RegExp) {
|
|
28
|
-
return new RegExp(orig)
|
|
24
|
+
return new RegExp(orig)
|
|
29
25
|
} else if (orig instanceof Date) {
|
|
30
|
-
return new Date(orig)
|
|
26
|
+
return new Date(orig)
|
|
31
27
|
}
|
|
32
|
-
|
|
33
|
-
for (
|
|
34
|
-
if (
|
|
35
|
-
newObj[
|
|
28
|
+
const newObj = {}
|
|
29
|
+
for (const i in orig) {
|
|
30
|
+
if (typeof orig[i] === 'object') {
|
|
31
|
+
newObj[i] = _copy(orig[i])
|
|
36
32
|
} else {
|
|
37
|
-
newObj[
|
|
33
|
+
newObj[i] = orig[i]
|
|
38
34
|
}
|
|
39
35
|
}
|
|
40
|
-
return newObj
|
|
41
|
-
}
|
|
36
|
+
return newObj
|
|
37
|
+
}
|
|
42
38
|
|
|
43
39
|
// Function usable by a ngettext implementation (apparently not an accessible part of setlocale(),
|
|
44
40
|
// but locale-specific) See https://www.gnu.org/software/gettext/manual/gettext.html#Plural-forms
|
|
@@ -54,37 +50,43 @@ module.exports = function setlocale(category, locale) {
|
|
|
54
50
|
// // e.g., Japanese
|
|
55
51
|
// return 0
|
|
56
52
|
// }
|
|
57
|
-
|
|
53
|
+
const _nplurals2a = function (n) {
|
|
58
54
|
// e.g., English
|
|
59
|
-
return n !== 1 ? 1 : 0
|
|
60
|
-
}
|
|
61
|
-
|
|
55
|
+
return n !== 1 ? 1 : 0
|
|
56
|
+
}
|
|
57
|
+
const _nplurals2b = function (n) {
|
|
62
58
|
// e.g., French
|
|
63
|
-
return n > 1 ? 1 : 0
|
|
64
|
-
}
|
|
59
|
+
return n > 1 ? 1 : 0
|
|
60
|
+
}
|
|
65
61
|
|
|
66
|
-
|
|
67
|
-
$global.$locutus = $global.$locutus || {}
|
|
68
|
-
|
|
69
|
-
$locutus.php = $locutus.php || {}
|
|
62
|
+
const $global = typeof window !== 'undefined' ? window : global
|
|
63
|
+
$global.$locutus = $global.$locutus || {}
|
|
64
|
+
const $locutus = $global.$locutus
|
|
65
|
+
$locutus.php = $locutus.php || {}
|
|
70
66
|
|
|
71
67
|
// Reconcile Windows vs. *nix locale names?
|
|
72
68
|
// Allow different priority orders of languages, esp. if implement gettext as in
|
|
73
69
|
// LANGUAGE env. var.? (e.g., show German if French is not available)
|
|
74
|
-
if (
|
|
70
|
+
if (
|
|
71
|
+
!$locutus.php.locales ||
|
|
72
|
+
!$locutus.php.locales.fr_CA ||
|
|
73
|
+
!$locutus.php.locales.fr_CA.LC_TIME ||
|
|
74
|
+
!$locutus.php.locales.fr_CA.LC_TIME.x
|
|
75
|
+
) {
|
|
75
76
|
// Can add to the locales
|
|
76
|
-
$locutus.php.locales = {}
|
|
77
|
+
$locutus.php.locales = {}
|
|
77
78
|
|
|
78
79
|
$locutus.php.locales.en = {
|
|
79
|
-
LC_COLLATE: function
|
|
80
|
+
LC_COLLATE: function (str1, str2) {
|
|
80
81
|
// @todo: This one taken from strcmp, but need for other locales; we don't use localeCompare
|
|
81
82
|
// since its locale is not settable
|
|
82
|
-
return str1 === str2 ? 0 : str1 > str2 ? 1 : -1
|
|
83
|
+
return str1 === str2 ? 0 : str1 > str2 ? 1 : -1
|
|
83
84
|
},
|
|
84
85
|
LC_CTYPE: {
|
|
85
86
|
// Need to change any of these for English as opposed to C?
|
|
86
87
|
an: /^[A-Za-z\d]+$/g,
|
|
87
88
|
al: /^[A-Za-z]+$/g,
|
|
89
|
+
// biome-ignore lint/suspicious/noControlCharactersInRegex: intentional for LC_CTYPE control character class
|
|
88
90
|
ct: /^[\u0000-\u001F\u007F]+$/g,
|
|
89
91
|
dg: /^[\d]+$/g,
|
|
90
92
|
gr: /^[\u0021-\u007E]+$/g,
|
|
@@ -97,7 +99,7 @@ module.exports = function setlocale(category, locale) {
|
|
|
97
99
|
CODESET: 'UTF-8',
|
|
98
100
|
// Used by sql_regcase
|
|
99
101
|
lower: 'abcdefghijklmnopqrstuvwxyz',
|
|
100
|
-
upper: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
|
|
102
|
+
upper: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
|
|
101
103
|
},
|
|
102
104
|
LC_TIME: {
|
|
103
105
|
// Comments include nl_langinfo() constant equivalents and any
|
|
@@ -108,7 +110,20 @@ module.exports = function setlocale(category, locale) {
|
|
|
108
110
|
// DAY_
|
|
109
111
|
b: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
|
|
110
112
|
// ABMON_
|
|
111
|
-
B: [
|
|
113
|
+
B: [
|
|
114
|
+
'January',
|
|
115
|
+
'February',
|
|
116
|
+
'March',
|
|
117
|
+
'April',
|
|
118
|
+
'May',
|
|
119
|
+
'June',
|
|
120
|
+
'July',
|
|
121
|
+
'August',
|
|
122
|
+
'September',
|
|
123
|
+
'October',
|
|
124
|
+
'November',
|
|
125
|
+
'December',
|
|
126
|
+
],
|
|
112
127
|
// MON_
|
|
113
128
|
c: '%a %d %b %Y %r %Z',
|
|
114
129
|
// D_T_FMT // changed %T to %r per results
|
|
@@ -129,7 +144,7 @@ module.exports = function setlocale(category, locale) {
|
|
|
129
144
|
ERA_YEAR: '',
|
|
130
145
|
ERA_D_T_FMT: '',
|
|
131
146
|
ERA_D_FMT: '',
|
|
132
|
-
ERA_T_FMT: ''
|
|
147
|
+
ERA_T_FMT: '',
|
|
133
148
|
},
|
|
134
149
|
// Assuming distinction between numeric and monetary is thus:
|
|
135
150
|
// See below for C locale
|
|
@@ -162,41 +177,41 @@ module.exports = function setlocale(category, locale) {
|
|
|
162
177
|
// 0: parentheses surround quantity and curr. symbol; 1: sign precedes them;
|
|
163
178
|
// 2: sign follows them; 3: sign immed. precedes curr. symbol; 4: sign immed.
|
|
164
179
|
// succeeds curr. symbol
|
|
165
|
-
n_sign_posn: 0 // see p_sign_posn
|
|
180
|
+
n_sign_posn: 0, // see p_sign_posn
|
|
166
181
|
},
|
|
167
182
|
LC_NUMERIC: {
|
|
168
183
|
// based on Windows "english" (English_United States.1252) locale
|
|
169
184
|
decimal_point: '.',
|
|
170
185
|
thousands_sep: ',',
|
|
171
|
-
grouping: [3] // see mon_grouping, but for non-monetary values (use thousands_sep)
|
|
186
|
+
grouping: [3], // see mon_grouping, but for non-monetary values (use thousands_sep)
|
|
172
187
|
},
|
|
173
188
|
LC_MESSAGES: {
|
|
174
189
|
YESEXPR: '^[yY].*',
|
|
175
190
|
NOEXPR: '^[nN].*',
|
|
176
191
|
YESSTR: '',
|
|
177
|
-
NOSTR: ''
|
|
192
|
+
NOSTR: '',
|
|
178
193
|
},
|
|
179
|
-
nplurals: _nplurals2a
|
|
180
|
-
}
|
|
181
|
-
$locutus.php.locales.en_US = _copy($locutus.php.locales.en)
|
|
182
|
-
$locutus.php.locales.en_US.LC_TIME.c = '%a %d %b %Y %r %Z'
|
|
183
|
-
$locutus.php.locales.en_US.LC_TIME.x = '%D'
|
|
184
|
-
$locutus.php.locales.en_US.LC_TIME.X = '%r'
|
|
194
|
+
nplurals: _nplurals2a,
|
|
195
|
+
}
|
|
196
|
+
$locutus.php.locales.en_US = _copy($locutus.php.locales.en)
|
|
197
|
+
$locutus.php.locales.en_US.LC_TIME.c = '%a %d %b %Y %r %Z'
|
|
198
|
+
$locutus.php.locales.en_US.LC_TIME.x = '%D'
|
|
199
|
+
$locutus.php.locales.en_US.LC_TIME.X = '%r'
|
|
185
200
|
// The following are based on *nix settings
|
|
186
|
-
$locutus.php.locales.en_US.LC_MONETARY.int_curr_symbol = 'USD '
|
|
187
|
-
$locutus.php.locales.en_US.LC_MONETARY.p_sign_posn = 1
|
|
188
|
-
$locutus.php.locales.en_US.LC_MONETARY.n_sign_posn = 1
|
|
189
|
-
$locutus.php.locales.en_US.LC_MONETARY.mon_grouping = [3, 3]
|
|
190
|
-
$locutus.php.locales.en_US.LC_NUMERIC.thousands_sep = ''
|
|
191
|
-
$locutus.php.locales.en_US.LC_NUMERIC.grouping = []
|
|
201
|
+
$locutus.php.locales.en_US.LC_MONETARY.int_curr_symbol = 'USD '
|
|
202
|
+
$locutus.php.locales.en_US.LC_MONETARY.p_sign_posn = 1
|
|
203
|
+
$locutus.php.locales.en_US.LC_MONETARY.n_sign_posn = 1
|
|
204
|
+
$locutus.php.locales.en_US.LC_MONETARY.mon_grouping = [3, 3]
|
|
205
|
+
$locutus.php.locales.en_US.LC_NUMERIC.thousands_sep = ''
|
|
206
|
+
$locutus.php.locales.en_US.LC_NUMERIC.grouping = []
|
|
192
207
|
|
|
193
|
-
$locutus.php.locales.en_GB = _copy($locutus.php.locales.en)
|
|
194
|
-
$locutus.php.locales.en_GB.LC_TIME.r = '%l:%M:%S %P %Z'
|
|
208
|
+
$locutus.php.locales.en_GB = _copy($locutus.php.locales.en)
|
|
209
|
+
$locutus.php.locales.en_GB.LC_TIME.r = '%l:%M:%S %P %Z'
|
|
195
210
|
|
|
196
|
-
$locutus.php.locales.en_AU = _copy($locutus.php.locales.en_GB)
|
|
211
|
+
$locutus.php.locales.en_AU = _copy($locutus.php.locales.en_GB)
|
|
197
212
|
// Assume C locale is like English (?) (We need C locale for LC_CTYPE)
|
|
198
|
-
$locutus.php.locales.C = _copy($locutus.php.locales.en)
|
|
199
|
-
$locutus.php.locales.C.LC_CTYPE.CODESET = 'ANSI_X3.4-1968'
|
|
213
|
+
$locutus.php.locales.C = _copy($locutus.php.locales.en)
|
|
214
|
+
$locutus.php.locales.C.LC_CTYPE.CODESET = 'ANSI_X3.4-1968'
|
|
200
215
|
$locutus.php.locales.C.LC_MONETARY = {
|
|
201
216
|
int_curr_symbol: '',
|
|
202
217
|
currency_symbol: '',
|
|
@@ -212,61 +227,91 @@ module.exports = function setlocale(category, locale) {
|
|
|
212
227
|
positive_sign: '',
|
|
213
228
|
negative_sign: '',
|
|
214
229
|
int_frac_digits: 127,
|
|
215
|
-
frac_digits: 127
|
|
216
|
-
}
|
|
230
|
+
frac_digits: 127,
|
|
231
|
+
}
|
|
217
232
|
$locutus.php.locales.C.LC_NUMERIC = {
|
|
218
233
|
decimal_point: '.',
|
|
219
234
|
thousands_sep: '',
|
|
220
|
-
grouping: []
|
|
221
|
-
|
|
222
|
-
|
|
235
|
+
grouping: [],
|
|
236
|
+
}
|
|
237
|
+
// D_T_FMT
|
|
238
|
+
$locutus.php.locales.C.LC_TIME.c = '%a %b %e %H:%M:%S %Y'
|
|
223
239
|
// D_FMT
|
|
224
|
-
$locutus.php.locales.C.LC_TIME.x = '%m/%d/%y'
|
|
240
|
+
$locutus.php.locales.C.LC_TIME.x = '%m/%d/%y'
|
|
225
241
|
// T_FMT
|
|
226
|
-
$locutus.php.locales.C.LC_TIME.X = '%H:%M:%S'
|
|
227
|
-
$locutus.php.locales.C.LC_MESSAGES.YESEXPR = '^[yY]'
|
|
228
|
-
$locutus.php.locales.C.LC_MESSAGES.NOEXPR = '^[nN]'
|
|
242
|
+
$locutus.php.locales.C.LC_TIME.X = '%H:%M:%S'
|
|
243
|
+
$locutus.php.locales.C.LC_MESSAGES.YESEXPR = '^[yY]'
|
|
244
|
+
$locutus.php.locales.C.LC_MESSAGES.NOEXPR = '^[nN]'
|
|
229
245
|
|
|
230
|
-
$locutus.php.locales.fr = _copy($locutus.php.locales.en)
|
|
231
|
-
$locutus.php.locales.fr.nplurals = _nplurals2b
|
|
232
|
-
$locutus.php.locales.fr.LC_TIME.a = ['dim', 'lun', 'mar', 'mer', 'jeu', 'ven', 'sam']
|
|
233
|
-
$locutus.php.locales.fr.LC_TIME.A = ['dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi']
|
|
234
|
-
$locutus.php.locales.fr.LC_TIME.b = [
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
246
|
+
$locutus.php.locales.fr = _copy($locutus.php.locales.en)
|
|
247
|
+
$locutus.php.locales.fr.nplurals = _nplurals2b
|
|
248
|
+
$locutus.php.locales.fr.LC_TIME.a = ['dim', 'lun', 'mar', 'mer', 'jeu', 'ven', 'sam']
|
|
249
|
+
$locutus.php.locales.fr.LC_TIME.A = ['dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi']
|
|
250
|
+
$locutus.php.locales.fr.LC_TIME.b = [
|
|
251
|
+
'jan',
|
|
252
|
+
'f\u00E9v',
|
|
253
|
+
'mar',
|
|
254
|
+
'avr',
|
|
255
|
+
'mai',
|
|
256
|
+
'jun',
|
|
257
|
+
'jui',
|
|
258
|
+
'ao\u00FB',
|
|
259
|
+
'sep',
|
|
260
|
+
'oct',
|
|
261
|
+
'nov',
|
|
262
|
+
'd\u00E9c',
|
|
263
|
+
]
|
|
264
|
+
$locutus.php.locales.fr.LC_TIME.B = [
|
|
265
|
+
'janvier',
|
|
266
|
+
'f\u00E9vrier',
|
|
267
|
+
'mars',
|
|
268
|
+
'avril',
|
|
269
|
+
'mai',
|
|
270
|
+
'juin',
|
|
271
|
+
'juillet',
|
|
272
|
+
'ao\u00FBt',
|
|
273
|
+
'septembre',
|
|
274
|
+
'octobre',
|
|
275
|
+
'novembre',
|
|
276
|
+
'd\u00E9cembre',
|
|
277
|
+
]
|
|
278
|
+
$locutus.php.locales.fr.LC_TIME.c = '%a %d %b %Y %T %Z'
|
|
279
|
+
$locutus.php.locales.fr.LC_TIME.p = ['', '']
|
|
280
|
+
$locutus.php.locales.fr.LC_TIME.P = ['', '']
|
|
281
|
+
$locutus.php.locales.fr.LC_TIME.x = '%d.%m.%Y'
|
|
282
|
+
$locutus.php.locales.fr.LC_TIME.X = '%T'
|
|
241
283
|
|
|
242
|
-
$locutus.php.locales.fr_CA = _copy($locutus.php.locales.fr)
|
|
243
|
-
$locutus.php.locales.fr_CA.LC_TIME.x = '%Y-%m-%d'
|
|
284
|
+
$locutus.php.locales.fr_CA = _copy($locutus.php.locales.fr)
|
|
285
|
+
$locutus.php.locales.fr_CA.LC_TIME.x = '%Y-%m-%d'
|
|
244
286
|
}
|
|
245
287
|
if (!$locutus.php.locale) {
|
|
246
|
-
$locutus.php.locale = 'en_US'
|
|
288
|
+
$locutus.php.locale = 'en_US'
|
|
247
289
|
// Try to establish the locale via the `window` global
|
|
248
290
|
if (typeof window !== 'undefined' && window.document) {
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
291
|
+
const d = window.document
|
|
292
|
+
const NS_XHTML = 'https://www.w3.org/1999/xhtml'
|
|
293
|
+
const NS_XML = 'https://www.w3.org/XML/1998/namespace'
|
|
252
294
|
if (d.getElementsByTagNameNS && d.getElementsByTagNameNS(NS_XHTML, 'html')[0]) {
|
|
253
|
-
if (
|
|
254
|
-
|
|
295
|
+
if (
|
|
296
|
+
d.getElementsByTagNameNS(NS_XHTML, 'html')[0].getAttributeNS &&
|
|
297
|
+
d.getElementsByTagNameNS(NS_XHTML, 'html')[0].getAttributeNS(NS_XML, 'lang')
|
|
298
|
+
) {
|
|
299
|
+
$locutus.php.locale = d.getElementsByTagName(NS_XHTML, 'html')[0].getAttributeNS(NS_XML, 'lang')
|
|
255
300
|
} else if (d.getElementsByTagNameNS(NS_XHTML, 'html')[0].lang) {
|
|
256
301
|
// XHTML 1.0 only
|
|
257
|
-
$locutus.php.locale = d.getElementsByTagNameNS(NS_XHTML, 'html')[0].lang
|
|
302
|
+
$locutus.php.locale = d.getElementsByTagNameNS(NS_XHTML, 'html')[0].lang
|
|
258
303
|
}
|
|
259
304
|
} else if (d.getElementsByTagName('html')[0] && d.getElementsByTagName('html')[0].lang) {
|
|
260
|
-
$locutus.php.locale = d.getElementsByTagName('html')[0].lang
|
|
305
|
+
$locutus.php.locale = d.getElementsByTagName('html')[0].lang
|
|
261
306
|
}
|
|
262
307
|
}
|
|
263
308
|
}
|
|
264
309
|
// PHP-style
|
|
265
|
-
$locutus.php.locale = $locutus.php.locale.replace('-', '_')
|
|
310
|
+
$locutus.php.locale = $locutus.php.locale.replace('-', '_')
|
|
266
311
|
// @todo: locale if declared locale hasn't been defined
|
|
267
312
|
if (!($locutus.php.locale in $locutus.php.locales)) {
|
|
268
313
|
if ($locutus.php.locale.replace(/_[a-zA-Z]+$/, '') in $locutus.php.locales) {
|
|
269
|
-
$locutus.php.locale = $locutus.php.locale.replace(/_[a-zA-Z]+$/, '')
|
|
314
|
+
$locutus.php.locale = $locutus.php.locale.replace(/_[a-zA-Z]+$/, '')
|
|
270
315
|
}
|
|
271
316
|
}
|
|
272
317
|
|
|
@@ -283,23 +328,23 @@ module.exports = function setlocale(category, locale) {
|
|
|
283
328
|
LC_TIME: $locutus.php.locale,
|
|
284
329
|
// for date and time formatting with strftime()
|
|
285
330
|
// for system responses (available if PHP was compiled with libintl):
|
|
286
|
-
LC_MESSAGES: $locutus.php.locale
|
|
287
|
-
}
|
|
331
|
+
LC_MESSAGES: $locutus.php.locale,
|
|
332
|
+
}
|
|
288
333
|
}
|
|
289
334
|
|
|
290
335
|
if (locale === null || locale === '') {
|
|
291
|
-
locale = getenv(category) || getenv('LANG')
|
|
292
|
-
} else if (
|
|
336
|
+
locale = getenv(category) || getenv('LANG')
|
|
337
|
+
} else if (Array.isArray(locale)) {
|
|
293
338
|
for (i = 0; i < locale.length; i++) {
|
|
294
339
|
if (!(locale[i] in $locutus.php.locales)) {
|
|
295
340
|
if (i === locale.length - 1) {
|
|
296
341
|
// none found
|
|
297
|
-
return false
|
|
342
|
+
return false
|
|
298
343
|
}
|
|
299
|
-
continue
|
|
344
|
+
continue
|
|
300
345
|
}
|
|
301
|
-
locale = locale[i]
|
|
302
|
-
break
|
|
346
|
+
locale = locale[i]
|
|
347
|
+
break
|
|
303
348
|
}
|
|
304
349
|
}
|
|
305
350
|
|
|
@@ -308,27 +353,26 @@ module.exports = function setlocale(category, locale) {
|
|
|
308
353
|
if (category === 'LC_ALL') {
|
|
309
354
|
for (categ in $locutus.php.localeCategories) {
|
|
310
355
|
// Add ".UTF-8" or allow ".@latint", etc. to the end?
|
|
311
|
-
cats.push(categ + '=' + $locutus.php.localeCategories[categ])
|
|
356
|
+
cats.push(categ + '=' + $locutus.php.localeCategories[categ])
|
|
312
357
|
}
|
|
313
|
-
return cats.join(';')
|
|
358
|
+
return cats.join(';')
|
|
314
359
|
}
|
|
315
|
-
return $locutus.php.localeCategories[category]
|
|
360
|
+
return $locutus.php.localeCategories[category]
|
|
316
361
|
}
|
|
317
362
|
|
|
318
363
|
if (!(locale in $locutus.php.locales)) {
|
|
319
364
|
// Locale not found
|
|
320
|
-
return false
|
|
365
|
+
return false
|
|
321
366
|
}
|
|
322
367
|
|
|
323
368
|
// Set and get locale
|
|
324
369
|
if (category === 'LC_ALL') {
|
|
325
370
|
for (categ in $locutus.php.localeCategories) {
|
|
326
|
-
$locutus.php.localeCategories[categ] = locale
|
|
371
|
+
$locutus.php.localeCategories[categ] = locale
|
|
327
372
|
}
|
|
328
373
|
} else {
|
|
329
|
-
$locutus.php.localeCategories[category] = locale
|
|
374
|
+
$locutus.php.localeCategories[category] = locale
|
|
330
375
|
}
|
|
331
376
|
|
|
332
|
-
return locale
|
|
333
|
-
}
|
|
334
|
-
//# sourceMappingURL=setlocale.js.map
|
|
377
|
+
return locale
|
|
378
|
+
}
|
package/php/strings/sha1.js
CHANGED
|
@@ -1,156 +1,158 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
1
|
module.exports = function sha1(str) {
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
//
|
|
14
|
-
|
|
15
|
-
|
|
2
|
+
// discuss at: https://locutus.io/php/sha1/
|
|
3
|
+
// parity verified: PHP 8.3
|
|
4
|
+
// original by: Webtoolkit.info (https://www.webtoolkit.info/)
|
|
5
|
+
// improved by: Michael White (https://getsprink.com)
|
|
6
|
+
// improved by: Kevin van Zonneveld (https://kvz.io)
|
|
7
|
+
// input by: Brett Zamir (https://brett-zamir.me)
|
|
8
|
+
// note 1: Keep in mind that in accordance with PHP, the whole string is buffered and then
|
|
9
|
+
// note 1: hashed. If available, we'd recommend using Node's native crypto modules directly
|
|
10
|
+
// note 1: in a steaming fashion for faster and more efficient hashing
|
|
11
|
+
// example 1: sha1('Kevin van Zonneveld')
|
|
12
|
+
// returns 1: '54916d2e62f65b3afa6e192e6a601cdbe5cb5897'
|
|
13
|
+
|
|
14
|
+
let hash
|
|
16
15
|
try {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
sha1sum.update(str)
|
|
20
|
-
hash = sha1sum.digest('hex')
|
|
21
|
-
} catch (
|
|
22
|
-
hash = undefined
|
|
16
|
+
const crypto = require('crypto')
|
|
17
|
+
const sha1sum = crypto.createHash('sha1')
|
|
18
|
+
sha1sum.update(str)
|
|
19
|
+
hash = sha1sum.digest('hex')
|
|
20
|
+
} catch (_e) {
|
|
21
|
+
hash = undefined
|
|
23
22
|
}
|
|
24
23
|
|
|
25
24
|
if (hash !== undefined) {
|
|
26
|
-
return hash
|
|
25
|
+
return hash
|
|
27
26
|
}
|
|
28
27
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return t4
|
|
32
|
-
}
|
|
28
|
+
const _rotLeft = function (n, s) {
|
|
29
|
+
const t4 = (n << s) | (n >>> (32 - s))
|
|
30
|
+
return t4
|
|
31
|
+
}
|
|
33
32
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
const _cvtHex = function (val) {
|
|
34
|
+
let str = ''
|
|
35
|
+
let i
|
|
36
|
+
let v
|
|
38
37
|
|
|
39
38
|
for (i = 7; i >= 0; i--) {
|
|
40
|
-
v = val >>> i * 4 & 0x0f
|
|
41
|
-
str += v.toString(16)
|
|
39
|
+
v = (val >>> (i * 4)) & 0x0f
|
|
40
|
+
str += v.toString(16)
|
|
42
41
|
}
|
|
43
|
-
return str
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
42
|
+
return str
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
let blockstart
|
|
46
|
+
let i
|
|
47
|
+
let j
|
|
48
|
+
const W = new Array(80)
|
|
49
|
+
let H0 = 0x67452301
|
|
50
|
+
let H1 = 0xefcdab89
|
|
51
|
+
let H2 = 0x98badcfe
|
|
52
|
+
let H3 = 0x10325476
|
|
53
|
+
let H4 = 0xc3d2e1f0
|
|
54
|
+
let A
|
|
55
|
+
let B
|
|
56
|
+
let C
|
|
57
|
+
let D
|
|
58
|
+
let E
|
|
59
|
+
let temp
|
|
61
60
|
|
|
62
61
|
// utf8_encode
|
|
63
|
-
str = unescape(encodeURIComponent(str))
|
|
64
|
-
|
|
62
|
+
str = unescape(encodeURIComponent(str))
|
|
63
|
+
const strLen = str.length
|
|
65
64
|
|
|
66
|
-
|
|
65
|
+
const wordArray = []
|
|
67
66
|
for (i = 0; i < strLen - 3; i += 4) {
|
|
68
|
-
j = str.charCodeAt(i) << 24 | str.charCodeAt(i + 1) << 16 | str.charCodeAt(i + 2) << 8 | str.charCodeAt(i + 3)
|
|
69
|
-
wordArray.push(j)
|
|
67
|
+
j = (str.charCodeAt(i) << 24) | (str.charCodeAt(i + 1) << 16) | (str.charCodeAt(i + 2) << 8) | str.charCodeAt(i + 3)
|
|
68
|
+
wordArray.push(j)
|
|
70
69
|
}
|
|
71
70
|
|
|
72
71
|
switch (strLen % 4) {
|
|
73
72
|
case 0:
|
|
74
|
-
i = 0x080000000
|
|
75
|
-
break
|
|
73
|
+
i = 0x080000000
|
|
74
|
+
break
|
|
76
75
|
case 1:
|
|
77
|
-
i = str.charCodeAt(strLen - 1) << 24 | 0x0800000
|
|
78
|
-
break
|
|
76
|
+
i = (str.charCodeAt(strLen - 1) << 24) | 0x0800000
|
|
77
|
+
break
|
|
79
78
|
case 2:
|
|
80
|
-
i = str.charCodeAt(strLen - 2) << 24 | str.charCodeAt(strLen - 1) << 16 | 0x08000
|
|
81
|
-
break
|
|
79
|
+
i = (str.charCodeAt(strLen - 2) << 24) | (str.charCodeAt(strLen - 1) << 16) | 0x08000
|
|
80
|
+
break
|
|
82
81
|
case 3:
|
|
83
|
-
i =
|
|
84
|
-
|
|
82
|
+
i =
|
|
83
|
+
(str.charCodeAt(strLen - 3) << 24) |
|
|
84
|
+
(str.charCodeAt(strLen - 2) << 16) |
|
|
85
|
+
(str.charCodeAt(strLen - 1) << 8) |
|
|
86
|
+
0x80
|
|
87
|
+
break
|
|
85
88
|
}
|
|
86
89
|
|
|
87
|
-
wordArray.push(i)
|
|
90
|
+
wordArray.push(i)
|
|
88
91
|
|
|
89
92
|
while (wordArray.length % 16 !== 14) {
|
|
90
|
-
wordArray.push(0)
|
|
93
|
+
wordArray.push(0)
|
|
91
94
|
}
|
|
92
95
|
|
|
93
|
-
wordArray.push(strLen >>> 29)
|
|
94
|
-
wordArray.push(strLen << 3 & 0x0ffffffff)
|
|
96
|
+
wordArray.push(strLen >>> 29)
|
|
97
|
+
wordArray.push((strLen << 3) & 0x0ffffffff)
|
|
95
98
|
|
|
96
99
|
for (blockstart = 0; blockstart < wordArray.length; blockstart += 16) {
|
|
97
100
|
for (i = 0; i < 16; i++) {
|
|
98
|
-
W[i] = wordArray[blockstart + i]
|
|
101
|
+
W[i] = wordArray[blockstart + i]
|
|
99
102
|
}
|
|
100
103
|
for (i = 16; i <= 79; i++) {
|
|
101
|
-
W[i] = _rotLeft(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1)
|
|
104
|
+
W[i] = _rotLeft(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1)
|
|
102
105
|
}
|
|
103
106
|
|
|
104
|
-
A = H0
|
|
105
|
-
B = H1
|
|
106
|
-
C = H2
|
|
107
|
-
D = H3
|
|
108
|
-
E = H4
|
|
107
|
+
A = H0
|
|
108
|
+
B = H1
|
|
109
|
+
C = H2
|
|
110
|
+
D = H3
|
|
111
|
+
E = H4
|
|
109
112
|
|
|
110
113
|
for (i = 0; i <= 19; i++) {
|
|
111
|
-
temp = _rotLeft(A, 5) + (B & C | ~B & D) + E + W[i] + 0x5a827999 & 0x0ffffffff
|
|
112
|
-
E = D
|
|
113
|
-
D = C
|
|
114
|
-
C = _rotLeft(B, 30)
|
|
115
|
-
B = A
|
|
116
|
-
A = temp
|
|
114
|
+
temp = (_rotLeft(A, 5) + ((B & C) | (~B & D)) + E + W[i] + 0x5a827999) & 0x0ffffffff
|
|
115
|
+
E = D
|
|
116
|
+
D = C
|
|
117
|
+
C = _rotLeft(B, 30)
|
|
118
|
+
B = A
|
|
119
|
+
A = temp
|
|
117
120
|
}
|
|
118
121
|
|
|
119
122
|
for (i = 20; i <= 39; i++) {
|
|
120
|
-
temp = _rotLeft(A, 5) + (B ^ C ^ D) + E + W[i] + 0x6ed9eba1 & 0x0ffffffff
|
|
121
|
-
E = D
|
|
122
|
-
D = C
|
|
123
|
-
C = _rotLeft(B, 30)
|
|
124
|
-
B = A
|
|
125
|
-
A = temp
|
|
123
|
+
temp = (_rotLeft(A, 5) + (B ^ C ^ D) + E + W[i] + 0x6ed9eba1) & 0x0ffffffff
|
|
124
|
+
E = D
|
|
125
|
+
D = C
|
|
126
|
+
C = _rotLeft(B, 30)
|
|
127
|
+
B = A
|
|
128
|
+
A = temp
|
|
126
129
|
}
|
|
127
130
|
|
|
128
131
|
for (i = 40; i <= 59; i++) {
|
|
129
|
-
temp = _rotLeft(A, 5) + (B & C | B & D | C & D) + E + W[i] + 0x8f1bbcdc & 0x0ffffffff
|
|
130
|
-
E = D
|
|
131
|
-
D = C
|
|
132
|
-
C = _rotLeft(B, 30)
|
|
133
|
-
B = A
|
|
134
|
-
A = temp
|
|
132
|
+
temp = (_rotLeft(A, 5) + ((B & C) | (B & D) | (C & D)) + E + W[i] + 0x8f1bbcdc) & 0x0ffffffff
|
|
133
|
+
E = D
|
|
134
|
+
D = C
|
|
135
|
+
C = _rotLeft(B, 30)
|
|
136
|
+
B = A
|
|
137
|
+
A = temp
|
|
135
138
|
}
|
|
136
139
|
|
|
137
140
|
for (i = 60; i <= 79; i++) {
|
|
138
|
-
temp = _rotLeft(A, 5) + (B ^ C ^ D) + E + W[i] + 0xca62c1d6 & 0x0ffffffff
|
|
139
|
-
E = D
|
|
140
|
-
D = C
|
|
141
|
-
C = _rotLeft(B, 30)
|
|
142
|
-
B = A
|
|
143
|
-
A = temp
|
|
141
|
+
temp = (_rotLeft(A, 5) + (B ^ C ^ D) + E + W[i] + 0xca62c1d6) & 0x0ffffffff
|
|
142
|
+
E = D
|
|
143
|
+
D = C
|
|
144
|
+
C = _rotLeft(B, 30)
|
|
145
|
+
B = A
|
|
146
|
+
A = temp
|
|
144
147
|
}
|
|
145
148
|
|
|
146
|
-
H0 = H0 + A & 0x0ffffffff
|
|
147
|
-
H1 = H1 + B & 0x0ffffffff
|
|
148
|
-
H2 = H2 + C & 0x0ffffffff
|
|
149
|
-
H3 = H3 + D & 0x0ffffffff
|
|
150
|
-
H4 = H4 + E & 0x0ffffffff
|
|
149
|
+
H0 = (H0 + A) & 0x0ffffffff
|
|
150
|
+
H1 = (H1 + B) & 0x0ffffffff
|
|
151
|
+
H2 = (H2 + C) & 0x0ffffffff
|
|
152
|
+
H3 = (H3 + D) & 0x0ffffffff
|
|
153
|
+
H4 = (H4 + E) & 0x0ffffffff
|
|
151
154
|
}
|
|
152
155
|
|
|
153
|
-
temp = _cvtHex(H0) + _cvtHex(H1) + _cvtHex(H2) + _cvtHex(H3) + _cvtHex(H4)
|
|
154
|
-
return temp.toLowerCase()
|
|
155
|
-
}
|
|
156
|
-
//# sourceMappingURL=sha1.js.map
|
|
156
|
+
temp = _cvtHex(H0) + _cvtHex(H1) + _cvtHex(H2) + _cvtHex(H3) + _cvtHex(H4)
|
|
157
|
+
return temp.toLowerCase()
|
|
158
|
+
}
|