mirror of
https://github.com/TiddlyWiki/TiddlyWiki5.git
synced 2026-04-28 12:54:40 +00:00
Move the editions into a subfolder
This commit is contained in:
44
editions/tw2/source/tiddlywiki/deprecated/Crypto.js
Executable file
44
editions/tw2/source/tiddlywiki/deprecated/Crypto.js
Executable file
@@ -0,0 +1,44 @@
|
||||
//--
|
||||
//-- Deprecated Crypto functions and associated conversion routines.
|
||||
//-- Use the jQuery.encoding functions directly instead.
|
||||
//--
|
||||
|
||||
// Crypto 'namespace'
|
||||
function Crypto() {}
|
||||
|
||||
// Convert a string to an array of big-endian 32-bit words
|
||||
Crypto.strToBe32s = function(str)
|
||||
{
|
||||
return jQuery.encoding.strToBe32s(str);
|
||||
};
|
||||
|
||||
// Convert an array of big-endian 32-bit words to a string
|
||||
Crypto.be32sToStr = function(be)
|
||||
{
|
||||
return jQuery.encoding.be32sToStr(be);
|
||||
};
|
||||
|
||||
// Convert an array of big-endian 32-bit words to a hex string
|
||||
Crypto.be32sToHex = function(be)
|
||||
{
|
||||
return jQuery.encoding.be32sToHex(be);
|
||||
};
|
||||
|
||||
// Return, in hex, the SHA-1 hash of a string
|
||||
Crypto.hexSha1Str = function(str)
|
||||
{
|
||||
return jQuery.encoding.digests.hexSha1Str(str);
|
||||
};
|
||||
|
||||
// Return the SHA-1 hash of a string
|
||||
Crypto.sha1Str = function(str)
|
||||
{
|
||||
return jQuery.encoding.digests.sha1Str(str);
|
||||
};
|
||||
|
||||
// Calculate the SHA-1 hash of an array of blen bytes of big-endian 32-bit words
|
||||
Crypto.sha1 = function(x,blen)
|
||||
{
|
||||
return jQuery.encoding.digests.sha1(x,blen);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user