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.
Files changed (23) hide show
  1. {bare_script-5.1.17/src/bare_script.egg-info → bare_script-5.2.1}/PKG-INFO +1 -1
  2. {bare_script-5.1.17 → bare_script-5.2.1}/pyproject.toml +1 -1
  3. {bare_script-5.1.17 → bare_script-5.2.1}/src/bare_script/include.py +63 -0
  4. {bare_script-5.1.17 → bare_script-5.2.1}/src/bare_script/include_source.py +519 -346
  5. {bare_script-5.1.17 → bare_script-5.2.1}/src/bare_script/library.py +32 -1
  6. {bare_script-5.1.17 → bare_script-5.2.1}/src/bare_script/options.py +32 -12
  7. {bare_script-5.1.17 → bare_script-5.2.1}/src/bare_script/runtime_c.c +6 -1
  8. bare_script-5.2.1/src/bare_script/wsgi.py +252 -0
  9. {bare_script-5.1.17 → bare_script-5.2.1/src/bare_script.egg-info}/PKG-INFO +1 -1
  10. {bare_script-5.1.17 → bare_script-5.2.1}/src/bare_script.egg-info/SOURCES.txt +1 -0
  11. {bare_script-5.1.17 → bare_script-5.2.1}/LICENSE +0 -0
  12. {bare_script-5.1.17 → bare_script-5.2.1}/README.md +0 -0
  13. {bare_script-5.1.17 → bare_script-5.2.1}/setup.cfg +0 -0
  14. {bare_script-5.1.17 → bare_script-5.2.1}/setup.py +0 -0
  15. {bare_script-5.1.17 → bare_script-5.2.1}/src/bare_script/__init__.py +0 -0
  16. {bare_script-5.1.17 → bare_script-5.2.1}/src/bare_script/__main__.py +0 -0
  17. {bare_script-5.1.17 → bare_script-5.2.1}/src/bare_script/bare.py +0 -0
  18. {bare_script-5.1.17 → bare_script-5.2.1}/src/bare_script/runtime.py +0 -0
  19. {bare_script-5.1.17 → bare_script-5.2.1}/src/bare_script/value.py +0 -0
  20. {bare_script-5.1.17 → bare_script-5.2.1}/src/bare_script.egg-info/dependency_links.txt +0 -0
  21. {bare_script-5.1.17 → bare_script-5.2.1}/src/bare_script.egg-info/entry_points.txt +0 -0
  22. {bare_script-5.1.17 → bare_script-5.2.1}/src/bare_script.egg-info/requires.txt +0 -0
  23. {bare_script-5.1.17 → bare_script-5.2.1}/src/bare_script.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bare-script
3
- Version: 5.1.17
3
+ Version: 5.2.1
4
4
  Summary: BareScript; a lightweight scripting and expression language
5
5
  Author-email: "Craig A. Hobbs" <craigahobbs@gmail.com>
6
6
  License-Expression: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "bare-script"
7
- version = "5.1.17"
7
+ version = "5.2.1"
8
8
  description = "BareScript; a lightweight scripting and expression language"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -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
  #