-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
368 additions
and
410 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
(ns | ||
^{:go-imports [] | ||
:doc "Implements base64 encoding as specified by RFC 4648."} | ||
(ns ^{:go-imports [] | ||
:doc "Implements base64 encoding as specified by RFC 4648."} | ||
base64) | ||
|
||
(defn ^String decode-string | ||
"Returns the bytes represented by the base64 string s." | ||
{:added "1.0" | ||
:go "decodeString(s)"} | ||
:go "decodeString(s)"} | ||
[^String s]) | ||
|
||
(defn ^String encode-string | ||
"Returns the base64 encoding of s." | ||
{:added "1.0" | ||
:go "encodeString(s)"} | ||
:go "encodeString(s)"} | ||
[^String s]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,58 @@ | ||
(ns | ||
^{:go-imports ["crypto/sha256" "crypto/sha512" "crypto/md5" "crypto/sha1"] | ||
:doc "Implements common cryptographic and hash functions."} | ||
(ns ^{:go-imports ["crypto/sha256" "crypto/sha512" "crypto/md5" "crypto/sha1"] | ||
:doc "Implements common cryptographic and hash functions."} | ||
crypto) | ||
|
||
(defn ^String hmac | ||
"Returns HMAC signature for message and key using specified algorithm. | ||
Algorithm is one of the following: :sha1, :sha224, :sha256, :sha384, :sha512." | ||
{:added "1.0" | ||
:go "hmacSum(algorithm, message, key)"} | ||
:go "hmacSum(algorithm, message, key)"} | ||
[^Keyword algorithm ^String message ^String key]) | ||
|
||
(defn ^String sha256 | ||
"Returns the SHA256 checksum of the data." | ||
{:added "1.0" | ||
:go "! t := sha256.Sum256([]byte(data)); _res := string(t[:])"} | ||
:go "! t := sha256.Sum256([]byte(data)); _res := string(t[:])"} | ||
[^String data]) | ||
|
||
(defn ^String sha224 | ||
"Returns the SHA224 checksum of the data." | ||
{:added "1.0" | ||
:go "! t := sha256.Sum224([]byte(data)); _res := string(t[:])"} | ||
:go "! t := sha256.Sum224([]byte(data)); _res := string(t[:])"} | ||
[^String data]) | ||
|
||
(defn ^String sha384 | ||
"Returns the SHA384 checksum of the data." | ||
{:added "1.0" | ||
:go "! t := sha512.Sum384([]byte(data)); _res := string(t[:])"} | ||
:go "! t := sha512.Sum384([]byte(data)); _res := string(t[:])"} | ||
[^String data]) | ||
|
||
(defn ^String sha512 | ||
"Returns the SHA512 checksum of the data." | ||
{:added "1.0" | ||
:go "! t := sha512.Sum512([]byte(data)); _res := string(t[:])"} | ||
:go "! t := sha512.Sum512([]byte(data)); _res := string(t[:])"} | ||
[^String data]) | ||
|
||
(defn ^String sha512-224 | ||
"Returns the SHA512/224 checksum of the data." | ||
{:added "1.0" | ||
:go "! t := sha512.Sum512_224([]byte(data)); _res := string(t[:])"} | ||
:go "! t := sha512.Sum512_224([]byte(data)); _res := string(t[:])"} | ||
[^String data]) | ||
|
||
(defn ^String sha512-256 | ||
"Returns the SHA512/256 checksum of the data." | ||
{:added "1.0" | ||
:go "! t := sha512.Sum512_256([]byte(data)); _res := string(t[:])"} | ||
:go "! t := sha512.Sum512_256([]byte(data)); _res := string(t[:])"} | ||
[^String data]) | ||
|
||
(defn ^String md5 | ||
"Returns the MD5 checksum of the data." | ||
{:added "1.0" | ||
:go "! t := md5.Sum([]byte(data)); _res := string(t[:])"} | ||
:go "! t := md5.Sum([]byte(data)); _res := string(t[:])"} | ||
[^String data]) | ||
|
||
(defn ^String sha1 | ||
"Returns the SHA1 checksum of the data." | ||
{:added "1.0" | ||
:go "! t := sha1.Sum([]byte(data)); _res := string(t[:])"} | ||
:go "! t := sha1.Sum([]byte(data)); _res := string(t[:])"} | ||
[^String data]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
(ns | ||
^{:go-imports ["encoding/hex"] | ||
:doc "Implements hexadecimal encoding and decoding."} | ||
(ns ^{:go-imports ["encoding/hex"] | ||
:doc "Implements hexadecimal encoding and decoding."} | ||
hex) | ||
|
||
(defn ^String decode-string | ||
"Returns the bytes represented by the hexadecimal string s." | ||
{:added "1.0" | ||
:go "! t, err := hex.DecodeString(s); PanicOnErr(err); _res := string(t)"} | ||
:go "! t, err := hex.DecodeString(s); PanicOnErr(err); _res := string(t)"} | ||
[^String s]) | ||
|
||
(defn ^String encode-string | ||
"Returns the hexadecimal encoding of s." | ||
{:added "1.0" | ||
:go "hex.EncodeToString([]byte(s))"} | ||
:go "hex.EncodeToString([]byte(s))"} | ||
[^String s]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
(ns | ||
^{:go-imports ["html"] | ||
:doc "Provides functions for escaping and unescaping HTML text."} | ||
(ns ^{:go-imports ["html"] | ||
:doc "Provides functions for escaping and unescaping HTML text."} | ||
html) | ||
|
||
(defn ^String escape | ||
"Escapes special characters like < to become <. It escapes only five such characters: <, >, &, ' and \"." | ||
{:added "1.0" | ||
:go "html.EscapeString(s)"} | ||
:go "html.EscapeString(s)"} | ||
[^String s]) | ||
|
||
(defn ^String unescape | ||
"Unescapes entities like < to become <." | ||
{:added "1.0" | ||
:go "html.UnescapeString(s)"} | ||
:go "html.UnescapeString(s)"} | ||
[^String s]) |
Oops, something went wrong.