package.json 6.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. {
  2. "name": "jssha",
  3. "version": "1.5.0",
  4. "description": "jsSHA is a JavaScript implementation of the entire family of SHA hashes as defined in FIPS 180-2 (SHA-1, SHA-224, SHA-256, SHA-384, and SHA-512) as well as HMAC",
  5. "main": "src/sha.js",
  6. "repository": {
  7. "type": "git",
  8. "url": "https://github.com/Caligatio/jsSHA.git"
  9. },
  10. "keywords": [
  11. "SHA-1",
  12. "SHA-256",
  13. "SHA-224",
  14. "SHA-384",
  15. "SHA-512",
  16. "SHA1",
  17. "SHA256",
  18. "SHA224",
  19. "SHA384",
  20. "SHA512",
  21. "SHA2",
  22. "HMAC",
  23. "hash"
  24. ],
  25. "license": "BSD",
  26. "author": {
  27. "name": "Brian Turek",
  28. "email": "brian.turek@gmail.com"
  29. },
  30. "bugs": {
  31. "url": "https://github.com/Caligatio/jsSHA/issues"
  32. },
  33. "engines": {
  34. "node": "*"
  35. },
  36. "homepage": "https://github.com/Caligatio/jsSHA",
  37. "dependencies": {},
  38. "devDependencies": {},
  39. "scripts": {
  40. "test": "echo \"Error: no test specified\" && exit 1"
  41. },
  42. "readme": "# jsSHA\nA JavaScript implementation of the complete Secure Hash Standard family\n\t\t(SHA-1, SHA-224, SHA-256, SHA-384, and SHA-512) as well as HMAC by\n\t\tBrian Turek\n\n## About\njsSHA is a javaScript implementation of the complete Secure Hash Algorithm\nfamily as defined by FIPS PUB 180-2\n(http://csrc.nist.gov/publications/fips/fips180-2/fips180-2withchangenotice.pdf).\n\nIt also includes the HMAC algorithm with SHA support as defined by FIPS PUB 198-1\n(http://csrc.nist.gov/publications/fips/fips198-1/FIPS-198-1_final.pdf)\n\nWith the slow phasing out of MD5 as the standard hash to use in web\napplications, a client-side implementation of the complete Secure Hash Standard\nfamily was needed. Due to SHA-384 and SHA-512's use of 64-bit values throughout\nthe algorithm, JavaScript can not easily natively support the calculation of\nthese hashes. As a result, a bit of hacking had to be done to make sure the\nvalues behaved themselves. SHA-224 was added to the Secure Hash Standard family\non 25 February 2004 so it was also included in this package.\n\n## Files\n**src/sha_dev.js**\n\nA commented implementation of the entire SHA family of hashes. Not to be used\nin production.\n\n**src/sha.js**\n\nA Google Closure Compiler optimized version of the entire library\n\n**src/sha1.js**\n\nA Google Closure Compiler optimized version the library with non SHA-1\nfunctionality removed\n\n**src/sha256.js**\n\nA Google Closure Compiler optimized version the library with non SHA-224/SHA-256\nfunctionality removed\n\n**src/sha512.js**\n\nA Google Closure Compiler optimized version the library with non SHA-384/SHA-512\nfunctionality removed\n\n**test/test.html**\n\nA test page that calculates various hashes and has their correct values\n\n**test/genHashRounds.py**\n\nA Python2 script that generates multi-round hash values\n\n**build/make-release**\n\nA Bash script that runs the various Google Closure Compiler commands to build\na release\n\n**build/externs.js**\n\nFile needed solely to make the Google Closure Compilter work\n\n## Usage\n\n### Browser\nInclude the desired JavaScript file (sha.js, sha1.js, sha256.js, or sha512.js)\nin your header (sha.js used below):\n\n\t<script type=\"text/javascript\" src=\"/path/to/sha.js\"></script>\n\nInstantiate a new jsSHA object with your string to be hashed and its format\n(HEX or TEXT) as the parameters. Then, call getHash with the desired hash\nvariant (SHA-1, SHA-224, SHA-256, SHA-384, or SHA-512) and output type\n(HEX or B64).\n\nIn the example below, \"This is a Test\" and \"SHA-512\" were used\nas the string to be hashed and variant respectively. Also, the HMAC using TEXT\nkey \"SecretKey\" and hashing algorithm SHA-512 was calculated.\n\n\tvar shaObj = new jsSHA(\"This is a Test\", \"TEXT\");\n\tvar hash = shaObj.getHash(\"SHA-512\", \"HEX\");\n\tvar hmac = shaObj.getHMAC(\"SecretKey\", \"TEXT\", \"SHA-512\", \"HEX\");\n\nThe constructor takes an optional parameter, encoding, that specifies the\nencoding used to encode TEXT-type inputs. Valid options are \"UTF8\" and \"UTF16\"\nand it defaults to \"UTF8\"\n\ngetHash takes two optional parameters, a numRounds integer and an outputFormatOpts\nhashlist. numRounds controls the number of hashing iterations/rounds performed\nand defaults to a value of \"1\" if not specified. outputFormatOpts dictates\nsome formatting options for the output. By default,\n`outputFormatOpts = {\"outputUpper\" : false, \"b64Pad\" : \"=\"}`. These\noptions are intelligently interpreted based upon the chosen output format.\n\ngetHMAC also takes an optional outputFormatOpts hashlist which operates the exact\nsame way as above.\n\n### Node.js\njsSHA is available through NPM and be installed by simply doing\n\n\tnpm install jssha\nTo use the module, first require it using:\n\n\tjsSHA = require(\"jssha\");\n\nThe rest of the instructions are identical to the [Browser](#browser) section above.\n\n## Compiling\nThis library makes use of the Google Closure Compiler\n(https://developers.google.com/closure/compiler) to both boost performance\nand reduce filesizes. To compile sha_dev.js into a customized output file, use\na command like the following:\n\n\tjava -jar compiler.jar --define=\"SUPPORTED_ALGS=<FLAG>\" \\\n\t\t--externs /path/to/build/externs.js --warning_level VERBOSE \\\n\t\t--compilation_level ADVANCED_OPTIMIZATIONS \\\n\t\t--js /path/to/sha_dev.js --js_output_file /path/to/sha.js\n\t\t\nwhere <FLAG> is a bitwise OR of the following values:\n* 4 for SHA-384/SHA-512\n* 2 for SHA-224/256\n* 1 for SHA-1\n\n##Contact Info\nThe project's website is located at [http://caligatio.github.com/jsSHA/](http://caligatio.github.com/jsSHA/)\n",
  43. "readmeFilename": "README.md",
  44. "_id": "jssha@1.5.0",
  45. "dist": {
  46. "shasum": "136123ea77a9d46e007f623ab5ee58a16a2636a1",
  47. "tarball": "http://registry.npmjs.org/jssha/-/jssha-1.5.0.tgz"
  48. },
  49. "_from": "jssha@^1.5.0",
  50. "_npmVersion": "1.3.17",
  51. "_npmUser": {
  52. "name": "caligatio",
  53. "email": "brian.turek@gmail.com"
  54. },
  55. "maintainers": [
  56. {
  57. "name": "caligatio",
  58. "email": "brian.turek@gmail.com"
  59. }
  60. ],
  61. "directories": {},
  62. "_shasum": "136123ea77a9d46e007f623ab5ee58a16a2636a1",
  63. "_resolved": "https://registry.npmjs.org/jssha/-/jssha-1.5.0.tgz"
  64. }