bare-script 5.1.17__tar.gz → 5.2.1__tar.gz
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.
- {bare_script-5.1.17/src/bare_script.egg-info → bare_script-5.2.1}/PKG-INFO +1 -1
- {bare_script-5.1.17 → bare_script-5.2.1}/pyproject.toml +1 -1
- {bare_script-5.1.17 → bare_script-5.2.1}/src/bare_script/include.py +63 -0
- {bare_script-5.1.17 → bare_script-5.2.1}/src/bare_script/include_source.py +519 -346
- {bare_script-5.1.17 → bare_script-5.2.1}/src/bare_script/library.py +32 -1
- {bare_script-5.1.17 → bare_script-5.2.1}/src/bare_script/options.py +32 -12
- {bare_script-5.1.17 → bare_script-5.2.1}/src/bare_script/runtime_c.c +6 -1
- bare_script-5.2.1/src/bare_script/wsgi.py +252 -0
- {bare_script-5.1.17 → bare_script-5.2.1/src/bare_script.egg-info}/PKG-INFO +1 -1
- {bare_script-5.1.17 → bare_script-5.2.1}/src/bare_script.egg-info/SOURCES.txt +1 -0
- {bare_script-5.1.17 → bare_script-5.2.1}/LICENSE +0 -0
- {bare_script-5.1.17 → bare_script-5.2.1}/README.md +0 -0
- {bare_script-5.1.17 → bare_script-5.2.1}/setup.cfg +0 -0
- {bare_script-5.1.17 → bare_script-5.2.1}/setup.py +0 -0
- {bare_script-5.1.17 → bare_script-5.2.1}/src/bare_script/__init__.py +0 -0
- {bare_script-5.1.17 → bare_script-5.2.1}/src/bare_script/__main__.py +0 -0
- {bare_script-5.1.17 → bare_script-5.2.1}/src/bare_script/bare.py +0 -0
- {bare_script-5.1.17 → bare_script-5.2.1}/src/bare_script/runtime.py +0 -0
- {bare_script-5.1.17 → bare_script-5.2.1}/src/bare_script/value.py +0 -0
- {bare_script-5.1.17 → bare_script-5.2.1}/src/bare_script.egg-info/dependency_links.txt +0 -0
- {bare_script-5.1.17 → bare_script-5.2.1}/src/bare_script.egg-info/entry_points.txt +0 -0
- {bare_script-5.1.17 → bare_script-5.2.1}/src/bare_script.egg-info/requires.txt +0 -0
- {bare_script-5.1.17 → bare_script-5.2.1}/src/bare_script.egg-info/top_level.txt +0 -0
|
@@ -22,6 +22,7 @@ execute_script(
|
|
|
22
22
|
{'url': 'dataTable.bare', 'system': True},
|
|
23
23
|
{'url': 'elementModel.bare', 'system': True},
|
|
24
24
|
{'url': 'gzip.bare', 'system': True},
|
|
25
|
+
{'url': 'hash.bare', 'system': True},
|
|
25
26
|
{'url': 'markdown.bare', 'system': True},
|
|
26
27
|
{'url': 'markdownElements.bare', 'system': True},
|
|
27
28
|
{'url': 'markdownParser.bare', 'system': True},
|
|
@@ -471,6 +472,68 @@ def gzip_uncompress(bytes_):
|
|
|
471
472
|
return _INCLUDE_GLOBALS['gzipUncompress']([bytes_], _include_options())
|
|
472
473
|
|
|
473
474
|
|
|
475
|
+
#
|
|
476
|
+
# hash.bare
|
|
477
|
+
#
|
|
478
|
+
|
|
479
|
+
|
|
480
|
+
def hash_equal(left, right):
|
|
481
|
+
"""
|
|
482
|
+
Compare two values (e.g. message authentication codes) in constant time - every byte is compared, so the time
|
|
483
|
+
taken doesn't reveal how much of a guessed value is right
|
|
484
|
+
|
|
485
|
+
:param left: The first byte value array or string
|
|
486
|
+
:type left: list(int) or str
|
|
487
|
+
:param right: The second byte value array or string
|
|
488
|
+
:type right: list(int) or str
|
|
489
|
+
:return: True if the values are equal, False if not, or None if an argument is invalid
|
|
490
|
+
:rtype: bool or None
|
|
491
|
+
"""
|
|
492
|
+
|
|
493
|
+
return _INCLUDE_GLOBALS['hashEqual']([left, right], _include_options())
|
|
494
|
+
|
|
495
|
+
|
|
496
|
+
def hash_hex(bytes_):
|
|
497
|
+
"""
|
|
498
|
+
Format a byte value array (e.g. a hash) as a lowercase hexadecimal string
|
|
499
|
+
|
|
500
|
+
:param bytes_: The byte value array or string
|
|
501
|
+
:type bytes_: list(int) or str
|
|
502
|
+
:return: The hexadecimal string, or None if the argument is invalid
|
|
503
|
+
:rtype: str or None
|
|
504
|
+
"""
|
|
505
|
+
|
|
506
|
+
return _INCLUDE_GLOBALS['hashHex']([bytes_], _include_options())
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+
def hash_hmac_sha256(key, message):
|
|
510
|
+
"""
|
|
511
|
+
Compute the HMAC-SHA256 message authentication code of a message (e.g. a JWT HS256 signature)
|
|
512
|
+
|
|
513
|
+
:param key: The key byte value array or string
|
|
514
|
+
:type key: list(int) or str
|
|
515
|
+
:param message: The message byte value array or string
|
|
516
|
+
:type message: list(int) or str
|
|
517
|
+
:return: The 32-byte message authentication code byte value array, or None if an argument is invalid
|
|
518
|
+
:rtype: list(int) or None
|
|
519
|
+
"""
|
|
520
|
+
|
|
521
|
+
return _INCLUDE_GLOBALS['hashHMACSHA256']([key, message], _include_options())
|
|
522
|
+
|
|
523
|
+
|
|
524
|
+
def hash_sha256(bytes_):
|
|
525
|
+
"""
|
|
526
|
+
Compute the SHA-256 hash of a byte value array (or a string, as UTF-8)
|
|
527
|
+
|
|
528
|
+
:param bytes_: The byte value array (integers 0 to 255) or string
|
|
529
|
+
:type bytes_: list(int) or str
|
|
530
|
+
:return: The 32-byte hash byte value array, or None if the argument is invalid
|
|
531
|
+
:rtype: list(int) or None
|
|
532
|
+
"""
|
|
533
|
+
|
|
534
|
+
return _INCLUDE_GLOBALS['hashSHA256']([bytes_], _include_options())
|
|
535
|
+
|
|
536
|
+
|
|
474
537
|
#
|
|
475
538
|
# markdown.bare
|
|
476
539
|
#
|