Fossil SCM

Enhancements to TH1 related to hashing. Add the 'hash' TH1 command.

mistachkin 2017-03-08 03:22 trunk
Commit 357c3c6836355c49fdf6ae154845fbf247368e21
+62 -1
--- src/th_main.c
+++ src/th_main.c
@@ -750,10 +750,11 @@
750750
** "json" = FOSSIL_ENABLE_JSON
751751
** "markdown" = FOSSIL_ENABLE_MARKDOWN
752752
** "unicodeCmdLine" = !BROKEN_MINGW_CMDLINE
753753
** "dynamicBuild" = FOSSIL_DYNAMIC_BUILD
754754
** "see" = USE_SEE
755
+** "hardenedSha1" = FOSSIL_HARDENED_SHA1
755756
**
756757
** Specifying an unknown feature will return a value of false, it will not
757758
** raise a script error.
758759
*/
759760
static int hasfeatureCmd(
@@ -766,11 +767,11 @@
766767
int rc = 0;
767768
const char *zArg;
768769
if( argc!=2 ){
769770
return Th_WrongNumArgs(interp, "hasfeature STRING");
770771
}
771
- zArg = (const char *)argv[1];
772
+ zArg = argv[1];
772773
if(NULL==zArg){
773774
/* placeholder for following ifdefs... */
774775
}
775776
#if defined(FOSSIL_ENABLE_SSL)
776777
else if( 0 == fossil_strnicmp( zArg, "ssl\0", 4 ) ){
@@ -834,10 +835,15 @@
834835
#endif
835836
#if defined(USE_SEE)
836837
else if( 0 == fossil_strnicmp( zArg, "see\0", 4 ) ){
837838
rc = 1;
838839
}
840
+#endif
841
+#if FOSSIL_HARDENED_SHA1
842
+ else if( 0 == fossil_strnicmp( zArg, "hardenedSha1\0", 13 ) ){
843
+ rc = 1;
844
+ }
839845
#endif
840846
else if( 0 == fossil_strnicmp( zArg, "markdown\0", 9 ) ){
841847
rc = 1;
842848
}
843849
if( g.thTrace ){
@@ -844,10 +850,64 @@
844850
Th_Trace("[hasfeature %#h] => %d<br />\n", argl[1], zArg, rc);
845851
}
846852
Th_SetResultInt(interp, rc);
847853
return TH_OK;
848854
}
855
+
856
+/*
857
+** TH1 command: hash STRING ?ALGORITHM?
858
+**
859
+** Returns the cryptographic hash of the specified string. Possible values
860
+** for the ALGORITHM argument are:
861
+**
862
+** "md5"
863
+** "sha1"
864
+** "sha3-224"
865
+** "sha3-256"
866
+** "sha3-384"
867
+** "sha3-512"
868
+**
869
+** The default algorithm is "sha3-256". Specifying an unknown algorithm
870
+** will raise a script error.
871
+*/
872
+static int hashCmd(
873
+ Th_Interp *interp,
874
+ void *p,
875
+ int argc,
876
+ const char **argv,
877
+ int *argl
878
+){
879
+ Blob content;
880
+ Blob cksum;
881
+ const char *zAlgorithm = "sha3-256";
882
+ if( argc<2 || argc>3 ){
883
+ return Th_WrongNumArgs(interp, "hash STRING ?ALGORITHM?");
884
+ }
885
+ blob_init(&content, argv[1], argl[1]);
886
+ blob_zero(&cksum);
887
+ if( argc>=3 ){
888
+ zAlgorithm = argv[2];
889
+ }
890
+ if( 0 == fossil_strnicmp( zAlgorithm, "md5\0", 4 ) ){
891
+ md5sum_blob(&content, &cksum);
892
+ }else if( 0 == fossil_strnicmp( zAlgorithm, "sha1\0", 5 ) ){
893
+ sha1sum_blob(&content, &cksum);
894
+ }else if( 0 == fossil_strnicmp( zAlgorithm, "sha3-224\0", 9 ) ){
895
+ sha3sum_blob(&content, 224, &cksum);
896
+ }else if( 0 == fossil_strnicmp( zAlgorithm, "sha3-256\0", 9 ) ){
897
+ sha3sum_blob(&content, 256, &cksum);
898
+ }else if( 0 == fossil_strnicmp( zAlgorithm, "sha3-384\0", 9 ) ){
899
+ sha3sum_blob(&content, 384, &cksum);
900
+ }else if( 0 == fossil_strnicmp( zAlgorithm, "sha3-512\0", 9 ) ){
901
+ sha3sum_blob(&content, 512, &cksum);
902
+ }else{
903
+ Th_SetResult(interp, "unknown hash algorithm", -1);
904
+ return TH_ERROR;
905
+ }
906
+ Th_SetResult(interp, blob_str(&cksum), -1);
907
+ return TH_OK;
908
+}
849909
850910
851911
/*
852912
** TH1 command: tclReady
853913
**
@@ -1961,10 +2021,11 @@
19612021
{"glob_match", globMatchCmd, 0},
19622022
{"globalState", globalStateCmd, 0},
19632023
{"httpize", httpizeCmd, 0},
19642024
{"hascap", hascapCmd, (void*)&zeroInt},
19652025
{"hasfeature", hasfeatureCmd, 0},
2026
+ {"hash", hashCmd, 0},
19662027
{"html", putsCmd, (void*)&aFlags[0]},
19672028
{"htmlize", htmlizeCmd, 0},
19682029
{"http", httpCmd, 0},
19692030
{"insertCsrf", insertCsrfCmd, 0},
19702031
{"linecount", linecntCmd, 0},
19712032
--- src/th_main.c
+++ src/th_main.c
@@ -750,10 +750,11 @@
750 ** "json" = FOSSIL_ENABLE_JSON
751 ** "markdown" = FOSSIL_ENABLE_MARKDOWN
752 ** "unicodeCmdLine" = !BROKEN_MINGW_CMDLINE
753 ** "dynamicBuild" = FOSSIL_DYNAMIC_BUILD
754 ** "see" = USE_SEE
 
755 **
756 ** Specifying an unknown feature will return a value of false, it will not
757 ** raise a script error.
758 */
759 static int hasfeatureCmd(
@@ -766,11 +767,11 @@
766 int rc = 0;
767 const char *zArg;
768 if( argc!=2 ){
769 return Th_WrongNumArgs(interp, "hasfeature STRING");
770 }
771 zArg = (const char *)argv[1];
772 if(NULL==zArg){
773 /* placeholder for following ifdefs... */
774 }
775 #if defined(FOSSIL_ENABLE_SSL)
776 else if( 0 == fossil_strnicmp( zArg, "ssl\0", 4 ) ){
@@ -834,10 +835,15 @@
834 #endif
835 #if defined(USE_SEE)
836 else if( 0 == fossil_strnicmp( zArg, "see\0", 4 ) ){
837 rc = 1;
838 }
 
 
 
 
 
839 #endif
840 else if( 0 == fossil_strnicmp( zArg, "markdown\0", 9 ) ){
841 rc = 1;
842 }
843 if( g.thTrace ){
@@ -844,10 +850,64 @@
844 Th_Trace("[hasfeature %#h] => %d<br />\n", argl[1], zArg, rc);
845 }
846 Th_SetResultInt(interp, rc);
847 return TH_OK;
848 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
849
850
851 /*
852 ** TH1 command: tclReady
853 **
@@ -1961,10 +2021,11 @@
1961 {"glob_match", globMatchCmd, 0},
1962 {"globalState", globalStateCmd, 0},
1963 {"httpize", httpizeCmd, 0},
1964 {"hascap", hascapCmd, (void*)&zeroInt},
1965 {"hasfeature", hasfeatureCmd, 0},
 
1966 {"html", putsCmd, (void*)&aFlags[0]},
1967 {"htmlize", htmlizeCmd, 0},
1968 {"http", httpCmd, 0},
1969 {"insertCsrf", insertCsrfCmd, 0},
1970 {"linecount", linecntCmd, 0},
1971
--- src/th_main.c
+++ src/th_main.c
@@ -750,10 +750,11 @@
750 ** "json" = FOSSIL_ENABLE_JSON
751 ** "markdown" = FOSSIL_ENABLE_MARKDOWN
752 ** "unicodeCmdLine" = !BROKEN_MINGW_CMDLINE
753 ** "dynamicBuild" = FOSSIL_DYNAMIC_BUILD
754 ** "see" = USE_SEE
755 ** "hardenedSha1" = FOSSIL_HARDENED_SHA1
756 **
757 ** Specifying an unknown feature will return a value of false, it will not
758 ** raise a script error.
759 */
760 static int hasfeatureCmd(
@@ -766,11 +767,11 @@
767 int rc = 0;
768 const char *zArg;
769 if( argc!=2 ){
770 return Th_WrongNumArgs(interp, "hasfeature STRING");
771 }
772 zArg = argv[1];
773 if(NULL==zArg){
774 /* placeholder for following ifdefs... */
775 }
776 #if defined(FOSSIL_ENABLE_SSL)
777 else if( 0 == fossil_strnicmp( zArg, "ssl\0", 4 ) ){
@@ -834,10 +835,15 @@
835 #endif
836 #if defined(USE_SEE)
837 else if( 0 == fossil_strnicmp( zArg, "see\0", 4 ) ){
838 rc = 1;
839 }
840 #endif
841 #if FOSSIL_HARDENED_SHA1
842 else if( 0 == fossil_strnicmp( zArg, "hardenedSha1\0", 13 ) ){
843 rc = 1;
844 }
845 #endif
846 else if( 0 == fossil_strnicmp( zArg, "markdown\0", 9 ) ){
847 rc = 1;
848 }
849 if( g.thTrace ){
@@ -844,10 +850,64 @@
850 Th_Trace("[hasfeature %#h] => %d<br />\n", argl[1], zArg, rc);
851 }
852 Th_SetResultInt(interp, rc);
853 return TH_OK;
854 }
855
856 /*
857 ** TH1 command: hash STRING ?ALGORITHM?
858 **
859 ** Returns the cryptographic hash of the specified string. Possible values
860 ** for the ALGORITHM argument are:
861 **
862 ** "md5"
863 ** "sha1"
864 ** "sha3-224"
865 ** "sha3-256"
866 ** "sha3-384"
867 ** "sha3-512"
868 **
869 ** The default algorithm is "sha3-256". Specifying an unknown algorithm
870 ** will raise a script error.
871 */
872 static int hashCmd(
873 Th_Interp *interp,
874 void *p,
875 int argc,
876 const char **argv,
877 int *argl
878 ){
879 Blob content;
880 Blob cksum;
881 const char *zAlgorithm = "sha3-256";
882 if( argc<2 || argc>3 ){
883 return Th_WrongNumArgs(interp, "hash STRING ?ALGORITHM?");
884 }
885 blob_init(&content, argv[1], argl[1]);
886 blob_zero(&cksum);
887 if( argc>=3 ){
888 zAlgorithm = argv[2];
889 }
890 if( 0 == fossil_strnicmp( zAlgorithm, "md5\0", 4 ) ){
891 md5sum_blob(&content, &cksum);
892 }else if( 0 == fossil_strnicmp( zAlgorithm, "sha1\0", 5 ) ){
893 sha1sum_blob(&content, &cksum);
894 }else if( 0 == fossil_strnicmp( zAlgorithm, "sha3-224\0", 9 ) ){
895 sha3sum_blob(&content, 224, &cksum);
896 }else if( 0 == fossil_strnicmp( zAlgorithm, "sha3-256\0", 9 ) ){
897 sha3sum_blob(&content, 256, &cksum);
898 }else if( 0 == fossil_strnicmp( zAlgorithm, "sha3-384\0", 9 ) ){
899 sha3sum_blob(&content, 384, &cksum);
900 }else if( 0 == fossil_strnicmp( zAlgorithm, "sha3-512\0", 9 ) ){
901 sha3sum_blob(&content, 512, &cksum);
902 }else{
903 Th_SetResult(interp, "unknown hash algorithm", -1);
904 return TH_ERROR;
905 }
906 Th_SetResult(interp, blob_str(&cksum), -1);
907 return TH_OK;
908 }
909
910
911 /*
912 ** TH1 command: tclReady
913 **
@@ -1961,10 +2021,11 @@
2021 {"glob_match", globMatchCmd, 0},
2022 {"globalState", globalStateCmd, 0},
2023 {"httpize", httpizeCmd, 0},
2024 {"hascap", hascapCmd, (void*)&zeroInt},
2025 {"hasfeature", hasfeatureCmd, 0},
2026 {"hash", hashCmd, 0},
2027 {"html", putsCmd, (void*)&aFlags[0]},
2028 {"htmlize", htmlizeCmd, 0},
2029 {"http", httpCmd, 0},
2030 {"insertCsrf", insertCsrfCmd, 0},
2031 {"linecount", linecntCmd, 0},
2032
--- test/th1.test
+++ test/th1.test
@@ -1598,9 +1598,62 @@
15981598
fossil test-th-eval --open-config \
15991599
{string length [unversioned content build-icons/src.gif]}
16001600
}
16011601
16021602
test th1-unversioned-2 {$RESULT eq {4592}}
1603
+
1604
+###############################################################################
1605
+
1606
+fossil test-th-eval {hash foo}
1607
+test th1-hash-1 {$RESULT eq \
1608
+"76d3bc41c9f588f7fcd0d5bf4718f8f84b1c41b20882703100b9eb9413807c01"}
1609
+
1610
+###############################################################################
1611
+
1612
+fossil test-th-eval {hash foo bad}
1613
+test th1-hash-2 {$RESULT eq "TH_ERROR: unknown hash algorithm"}
1614
+
1615
+###############################################################################
1616
+
1617
+fossil test-th-eval {hash foo md5}
1618
+test th1-hash-3 {$RESULT eq "acbd18db4cc2f85cedef654fccc4a4d8"}
1619
+
1620
+###############################################################################
1621
+
1622
+fossil test-th-eval {hash foo md5 bad}
1623
+test th1-hash-4 {$RESULT eq \
1624
+"TH_ERROR: wrong # args: should be \"hash STRING ?ALGORITHM?\""}
1625
+
1626
+###############################################################################
1627
+
1628
+fossil test-th-eval {hash foo sha1}
1629
+test th1-hash-5 {$RESULT eq "0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33"}
1630
+
1631
+###############################################################################
1632
+
1633
+fossil test-th-eval {hash foo sha3-224}
1634
+test th1-hash-6 {$RESULT eq \
1635
+"f4f6779e153c391bbd29c95e72b0708e39d9166c7cea51d1f10ef58a"}
1636
+
1637
+###############################################################################
1638
+
1639
+fossil test-th-eval {hash foo sha3-256}
1640
+test th1-hash-7 {$RESULT eq \
1641
+"76d3bc41c9f588f7fcd0d5bf4718f8f84b1c41b20882703100b9eb9413807c01"}
1642
+
1643
+###############################################################################
1644
+
1645
+fossil test-th-eval {hash foo sha3-384}
1646
+test th1-hash-8 {$RESULT eq [appendArgs \
1647
+665551928d13b7d84ee02734502b018d896a0fb87eed5adb4c87ba91bbd6489410e11b0fbcc06 \
1648
+ed7d0ebad559e5d3bb5]}
1649
+
1650
+###############################################################################
1651
+
1652
+fossil test-th-eval {hash foo sha3-512}
1653
+test th1-hash-9 {$RESULT eq [appendArgs \
1654
+4bca2b137edc580fe50a88983ef860ebaca36c857b1f492839d6d7392452a63c82cbebc68e3b7 \
1655
+0a2a1480b4bb5d437a7cba6ecf9d89f9ff3ccd14cd6146ea7e7]}
16031656
16041657
###############################################################################
16051658
16061659
test_cleanup
16071660
--- test/th1.test
+++ test/th1.test
@@ -1598,9 +1598,62 @@
1598 fossil test-th-eval --open-config \
1599 {string length [unversioned content build-icons/src.gif]}
1600 }
1601
1602 test th1-unversioned-2 {$RESULT eq {4592}}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1603
1604 ###############################################################################
1605
1606 test_cleanup
1607
--- test/th1.test
+++ test/th1.test
@@ -1598,9 +1598,62 @@
1598 fossil test-th-eval --open-config \
1599 {string length [unversioned content build-icons/src.gif]}
1600 }
1601
1602 test th1-unversioned-2 {$RESULT eq {4592}}
1603
1604 ###############################################################################
1605
1606 fossil test-th-eval {hash foo}
1607 test th1-hash-1 {$RESULT eq \
1608 "76d3bc41c9f588f7fcd0d5bf4718f8f84b1c41b20882703100b9eb9413807c01"}
1609
1610 ###############################################################################
1611
1612 fossil test-th-eval {hash foo bad}
1613 test th1-hash-2 {$RESULT eq "TH_ERROR: unknown hash algorithm"}
1614
1615 ###############################################################################
1616
1617 fossil test-th-eval {hash foo md5}
1618 test th1-hash-3 {$RESULT eq "acbd18db4cc2f85cedef654fccc4a4d8"}
1619
1620 ###############################################################################
1621
1622 fossil test-th-eval {hash foo md5 bad}
1623 test th1-hash-4 {$RESULT eq \
1624 "TH_ERROR: wrong # args: should be \"hash STRING ?ALGORITHM?\""}
1625
1626 ###############################################################################
1627
1628 fossil test-th-eval {hash foo sha1}
1629 test th1-hash-5 {$RESULT eq "0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33"}
1630
1631 ###############################################################################
1632
1633 fossil test-th-eval {hash foo sha3-224}
1634 test th1-hash-6 {$RESULT eq \
1635 "f4f6779e153c391bbd29c95e72b0708e39d9166c7cea51d1f10ef58a"}
1636
1637 ###############################################################################
1638
1639 fossil test-th-eval {hash foo sha3-256}
1640 test th1-hash-7 {$RESULT eq \
1641 "76d3bc41c9f588f7fcd0d5bf4718f8f84b1c41b20882703100b9eb9413807c01"}
1642
1643 ###############################################################################
1644
1645 fossil test-th-eval {hash foo sha3-384}
1646 test th1-hash-8 {$RESULT eq [appendArgs \
1647 665551928d13b7d84ee02734502b018d896a0fb87eed5adb4c87ba91bbd6489410e11b0fbcc06 \
1648 ed7d0ebad559e5d3bb5]}
1649
1650 ###############################################################################
1651
1652 fossil test-th-eval {hash foo sha3-512}
1653 test th1-hash-9 {$RESULT eq [appendArgs \
1654 4bca2b137edc580fe50a88983ef860ebaca36c857b1f492839d6d7392452a63c82cbebc68e3b7 \
1655 0a2a1480b4bb5d437a7cba6ecf9d89f9ff3ccd14cd6146ea7e7]}
1656
1657 ###############################################################################
1658
1659 test_cleanup
1660
--- win/fossil.rc
+++ win/fossil.rc
@@ -112,10 +112,17 @@
112112
#if defined(FOSSIL_ENABLE_MINIZ)
113113
VALUE "MinizVersion", "miniz " MZ_VERSION "\0"
114114
#else
115115
VALUE "ZlibVersion", "zlib " ZLIB_VERSION "\0"
116116
#endif /* defined(FOSSIL_ENABLE_MINIZ) */
117
+#if FOSSIL_HARDENED_SHA1
118
+ VALUE "Sha1", "Hardened-SHA1 by Marc Stevens and Dan Shumow\0"
119
+#elif defined(FOSSIL_ENABLE_SSL)
120
+ VALUE "Sha1", "OpenSSL-SHA1\0"
121
+#else
122
+ VALUE "Sha1", "Legacy-SHA1\0"
123
+#endif /* FOSSIL_HARDENED_SHA1 */
117124
#if defined(BROKEN_MINGW_CMDLINE)
118125
VALUE "CommandLineIsUnicode", "No\0"
119126
#else
120127
VALUE "CommandLineIsUnicode", "Yes\0"
121128
#endif /* defined(BROKEN_MINGW_CMDLINE) */
122129
--- win/fossil.rc
+++ win/fossil.rc
@@ -112,10 +112,17 @@
112 #if defined(FOSSIL_ENABLE_MINIZ)
113 VALUE "MinizVersion", "miniz " MZ_VERSION "\0"
114 #else
115 VALUE "ZlibVersion", "zlib " ZLIB_VERSION "\0"
116 #endif /* defined(FOSSIL_ENABLE_MINIZ) */
 
 
 
 
 
 
 
117 #if defined(BROKEN_MINGW_CMDLINE)
118 VALUE "CommandLineIsUnicode", "No\0"
119 #else
120 VALUE "CommandLineIsUnicode", "Yes\0"
121 #endif /* defined(BROKEN_MINGW_CMDLINE) */
122
--- win/fossil.rc
+++ win/fossil.rc
@@ -112,10 +112,17 @@
112 #if defined(FOSSIL_ENABLE_MINIZ)
113 VALUE "MinizVersion", "miniz " MZ_VERSION "\0"
114 #else
115 VALUE "ZlibVersion", "zlib " ZLIB_VERSION "\0"
116 #endif /* defined(FOSSIL_ENABLE_MINIZ) */
117 #if FOSSIL_HARDENED_SHA1
118 VALUE "Sha1", "Hardened-SHA1 by Marc Stevens and Dan Shumow\0"
119 #elif defined(FOSSIL_ENABLE_SSL)
120 VALUE "Sha1", "OpenSSL-SHA1\0"
121 #else
122 VALUE "Sha1", "Legacy-SHA1\0"
123 #endif /* FOSSIL_HARDENED_SHA1 */
124 #if defined(BROKEN_MINGW_CMDLINE)
125 VALUE "CommandLineIsUnicode", "No\0"
126 #else
127 VALUE "CommandLineIsUnicode", "Yes\0"
128 #endif /* defined(BROKEN_MINGW_CMDLINE) */
129
+20
--- www/th1.md
+++ www/th1.md
@@ -146,10 +146,11 @@
146146
* getParameter
147147
* glob\_match
148148
* globalState
149149
* hascap
150150
* hasfeature
151
+ * hash
151152
* html
152153
* htmlize
153154
* http
154155
* httpize
155156
* insertCsrf
@@ -345,13 +346,32 @@
345346
1. **json** -- _Support for the JSON APIs._
346347
1. **markdown** -- _Support for Markdown documentation format._
347348
1. **unicodeCmdLine** -- _The command line arguments are Unicode._
348349
1. **dynamicBuild** -- _Dynamically linked to libraries._
349350
1. **see** -- _Uses the SQLite Encryption Extension._
351
+ 1. **hardenedSha1** -- _Uses the <a href="https://github.com/cr-marcstevens/sha1collisiondetection">Hardened-SHA1</a> implementation._
350352
351353
Specifying an unknown feature will return a value of false, it will not
352354
raise a script error.
355
+
356
+<a name="hash"></a>TH1 hash Command
357
+-----------------------------------
358
+
359
+ * hash STRING ?ALGORITHM?
360
+
361
+Returns the cryptographic hash of the specified string. Possible values
362
+for the ALGORITHM argument are:
363
+
364
+ 1. **md5**
365
+ 1. **sha1**
366
+ 1. **sha3-224**
367
+ 1. **sha3-256**
368
+ 1. **sha3-384**
369
+ 1. **sha3-512**
370
+
371
+The default algorithm is "sha3-256". Specifying an unknown algorithm
372
+will raise a script error.
353373
354374
<a name="html"></a>TH1 html Command
355375
-----------------------------------
356376
357377
* html STRING
358378
--- www/th1.md
+++ www/th1.md
@@ -146,10 +146,11 @@
146 * getParameter
147 * glob\_match
148 * globalState
149 * hascap
150 * hasfeature
 
151 * html
152 * htmlize
153 * http
154 * httpize
155 * insertCsrf
@@ -345,13 +346,32 @@
345 1. **json** -- _Support for the JSON APIs._
346 1. **markdown** -- _Support for Markdown documentation format._
347 1. **unicodeCmdLine** -- _The command line arguments are Unicode._
348 1. **dynamicBuild** -- _Dynamically linked to libraries._
349 1. **see** -- _Uses the SQLite Encryption Extension._
 
350
351 Specifying an unknown feature will return a value of false, it will not
352 raise a script error.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
353
354 <a name="html"></a>TH1 html Command
355 -----------------------------------
356
357 * html STRING
358
--- www/th1.md
+++ www/th1.md
@@ -146,10 +146,11 @@
146 * getParameter
147 * glob\_match
148 * globalState
149 * hascap
150 * hasfeature
151 * hash
152 * html
153 * htmlize
154 * http
155 * httpize
156 * insertCsrf
@@ -345,13 +346,32 @@
346 1. **json** -- _Support for the JSON APIs._
347 1. **markdown** -- _Support for Markdown documentation format._
348 1. **unicodeCmdLine** -- _The command line arguments are Unicode._
349 1. **dynamicBuild** -- _Dynamically linked to libraries._
350 1. **see** -- _Uses the SQLite Encryption Extension._
351 1. **hardenedSha1** -- _Uses the <a href="https://github.com/cr-marcstevens/sha1collisiondetection">Hardened-SHA1</a> implementation._
352
353 Specifying an unknown feature will return a value of false, it will not
354 raise a script error.
355
356 <a name="hash"></a>TH1 hash Command
357 -----------------------------------
358
359 * hash STRING ?ALGORITHM?
360
361 Returns the cryptographic hash of the specified string. Possible values
362 for the ALGORITHM argument are:
363
364 1. **md5**
365 1. **sha1**
366 1. **sha3-224**
367 1. **sha3-256**
368 1. **sha3-384**
369 1. **sha3-512**
370
371 The default algorithm is "sha3-256". Specifying an unknown algorithm
372 will raise a script error.
373
374 <a name="html"></a>TH1 html Command
375 -----------------------------------
376
377 * html STRING
378

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button