{"_id":"@15ms/signing","_rev":"4-ee1888d2a81f8b3cf836784f02bdf6c3","name":"@15ms/signing","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"@15ms/signing","version":"0.1.0","keywords":["15ms","signing"],"author":{"url":"https://sartrey.cn","name":"Sartrey Lee","email":"sartrey@163.com"},"license":"MIT","_id":"@15ms/signing@0.1.0","maintainers":[{"name":"sartrey","email":"sartrey@163.com"}],"homepage":"https://github.com/15ms/signing#readme","bugs":{"url":"https://github.com/15ms/signing/issues"},"dist":{"shasum":"566723a7428cbe519b43d99f95aad2b898fe7e89","tarball":"https://registry.npmjs.org/@15ms/signing/-/signing-0.1.0.tgz","fileCount":11,"integrity":"sha512-5YWRXRnfQmAE6JfIiblBv8CFlKMA9s7uxsFXpt53Vshsa2Ga9Y+vvJX/dcA5xpyToVDNgiKniR+Jd8AVvF2ecw==","signatures":[{"sig":"MEUCIGpiPOi6rpMKEaH4zlFSAF/N66J9LKqMB0k8bb7YnjI7AiEA/smeu1S/VOO478DRkSAzeia5N1ySm/hEjwZwKHK1Nis=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9707},"main":"build/index.js","type":"module","types":"./build/index.d.ts","engines":{"node":">=20.0.0"},"exports":"./build/index.js","gitHead":"d2307e31be38063bd94f28975ca425b0bc4b79c3","scripts":{"lcov":"nyc report --reporter=text-lcov | coveralls","test":"npm run build && nyc --reporter=lcov mocha test/index.js --exit","build":"npm run clean && eslint --ext .ts && tsc","clean":"rm -rf build && rm -rf coverage && rm -rf .nyc_output"},"_npmUser":{"name":"sartrey","email":"sartrey@163.com"},"repository":{"url":"git+https://github.com/15ms/signing.git","type":"git"},"_npmVersion":"10.2.5","description":"A toolkit for 15ms services to create or verify message signing.","directories":{},"_nodeVersion":"20.10.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.20.1","@types/node":"^20.11.16","@epiijs/eslint-config":"^1.0.1"},"_npmOperationalInternal":{"tmp":"tmp/signing_0.1.0_1745937381588_0.761845750844623","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.1":{"name":"@15ms/signing","version":"0.1.1","keywords":["15ms","signing"],"author":{"url":"https://sartrey.cn","name":"Sartrey Lee","email":"sartrey@163.com"},"license":"MIT","_id":"@15ms/signing@0.1.1","maintainers":[{"name":"sartrey","email":"sartrey@163.com"}],"homepage":"https://github.com/15ms/signing#readme","bugs":{"url":"https://github.com/15ms/signing/issues"},"dist":{"shasum":"4f3a52945acfda97cd01848eef071dc7f571f399","tarball":"https://registry.npmjs.org/@15ms/signing/-/signing-0.1.1.tgz","fileCount":11,"integrity":"sha512-XDv15Zajs5GlHm30kO4T0Qneb3v5CAknEaJ0bF/Cpn410e8Ws//NbtVMc3XmD3RI60nFhvkp9vaDSxPwJmG4Xg==","signatures":[{"sig":"MEQCIFbVbKUp6EcbEBHZ+8vWh1zlCVrtqXhzmsqSmGHvfF5uAiB2MgFuubzn3byj3142vjMYIyDeSDi/yeRuaiyZTJfftA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9799},"main":"build/index.js","type":"module","types":"./build/index.d.ts","engines":{"node":">=20.0.0"},"exports":"./build/index.js","gitHead":"d4b45ea8bed632ee9cde588bbd1da83cab7bf2fb","scripts":{"lcov":"nyc report --reporter=text-lcov | coveralls","test":"npm run build && nyc --reporter=lcov mocha test/index.js --exit","build":"npm run clean && eslint --ext .ts && tsc","clean":"rm -rf build && rm -rf coverage && rm -rf .nyc_output"},"_npmUser":{"name":"sartrey","email":"sartrey@163.com"},"repository":{"url":"git+https://github.com/15ms/signing.git","type":"git"},"_npmVersion":"10.2.5","description":"A toolkit for 15ms services to create or verify message signing.","directories":{},"_nodeVersion":"20.10.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.20.1","@types/node":"^20.11.16","@epiijs/eslint-config":"^1.0.1"},"_npmOperationalInternal":{"tmp":"tmp/signing_0.1.1_1745939600461_0.3751459654642688","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.2":{"name":"@15ms/signing","version":"0.1.2","keywords":["15ms","signing"],"author":{"url":"https://sartrey.cn","name":"Sartrey Lee","email":"sartrey@163.com"},"license":"MIT","_id":"@15ms/signing@0.1.2","maintainers":[{"name":"sartrey","email":"sartrey@163.com"}],"homepage":"https://github.com/15ms/signing#readme","bugs":{"url":"https://github.com/15ms/signing/issues"},"dist":{"shasum":"7f96b171924006dbdbfddcd30bc471c1dab20bd5","tarball":"https://registry.npmjs.org/@15ms/signing/-/signing-0.1.2.tgz","fileCount":11,"integrity":"sha512-TLjCxCTaOpfJAMj4atdQ8sMghn/VLOPh/zRyJrIFLjBJGnK54Ib9tlXTNbom69IpIteDAZP3oh/rXExA/AsAWg==","signatures":[{"sig":"MEUCIQDVzI7kS+LX7iLgz8Tthky1lCtG0DbND1QswtAYJbADzQIgVP+DcNRIIKN+VLo55FHfv2TqkKNDE357RzAbGX4yp0g=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9717},"main":"build/index.js","type":"module","types":"./build/index.d.ts","engines":{"node":">=20.0.0"},"exports":"./build/index.js","gitHead":"34afe8f7f09e91ab8b0667f758926e839d07353f","scripts":{"test":"npm run build && c8 --reporter=lcov mocha","build":"npm run clean && eslint --ext .ts && tsc","clean":"rm -rf build && rm -rf coverage"},"_npmUser":{"name":"sartrey","email":"sartrey@163.com"},"repository":{"url":"git+https://github.com/15ms/signing.git","type":"git"},"_npmVersion":"10.2.5","description":"A toolkit for 15ms services to create or verify message signing.","directories":{},"_nodeVersion":"20.10.0","_hasShrinkwrap":false,"devDependencies":{"c8":"^10.1.3","mocha":"^11.2.2","eslint":"^9.20.1","@types/node":"^20.11.16","@epiijs/eslint-config":"^1.0.1"},"_npmOperationalInternal":{"tmp":"tmp/signing_0.1.2_1746169883503_0.8746643331822823","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."}},"time":{"created":"2025-04-29T14:36:21.531Z","modified":"2026-08-02T07:47:17.473Z","0.1.0":"2025-04-29T14:36:21.763Z","0.1.1":"2025-04-29T15:13:20.625Z","0.1.2":"2025-05-02T07:11:23.671Z"},"bugs":{"url":"https://github.com/15ms/signing/issues"},"author":{"url":"https://sartrey.cn","name":"Sartrey Lee","email":"sartrey@163.com"},"license":"MIT","homepage":"https://github.com/15ms/signing#readme","keywords":["15ms","signing"],"repository":{"url":"git+https://github.com/15ms/signing.git","type":"git"},"description":"A toolkit for 15ms services to create or verify message signing.","maintainers":[{"name":"sartrey","email":"sartrey@163.com"}],"readme":"# @15ms/signing\n\nA toolkit for 15ms services to create or verify message signing.\n\n# Install\n\n```bash\nnpm i @15ms/signing --save\n```\n\n# Usage\n\n## create or verify message signing\n\n```ts\nimport {\n  createSignature,\n  verifySignature\n} from '@15ms/signing';\n\nconst signature: string = await createSignature({\n  algorithm: '15ms-v1-hmac-sha256',\n  credential: 'Credential', // YourCredential\n  accessToken: 'AccessToken', // getAccessTokenByCredential(YourCredential)\n  resourceURI: 'ResourceURI', // such as /account/detail\n  contentHash: 'ContentHash' // hex(md5(YourRequestBody))\n});\n\nconst matched: boolean = await verifySignature({\n  signature: 'YourSignature',\n  algorithm: '15ms-v1-hmac-sha256',\n  credential: 'Credential', // YourCredential\n  accessToken: 'AccessToken', // getAccessTokenByCredential(YourCredential)\n  resourceURI: 'ResourceURI', // such as /account/detail\n  contentHash: 'ContentHash' // hex(md5(YourRequestBody))\n});\n```\n\n## build or parse authorization header\n\n```ts\nimport {\n  buildAuthorization,\n  parseAuthorization,\n  IAuthorization\n} from '@15ms/signing';\n\nconst authorization: string = buildAuthorization({\n  algorithm: '15ms-v1-hmac-sha256',\n  credential: 'Credential', // AccountID or AccountID/SessionID\n  resourceURI: 'ResourceURI', // such as /account/detail\n  contentHash: 'ContentHash', // hex(md5(YourRequestBody))\n  signature: 'Signature' // YourSignature\n});\n\nconst {\n  algorithm,\n  credential,\n  resourceURI,\n  contentHash,\n  signature\n}: IAuthorization = parseAuthorization(authorization);\n```\n","readmeFilename":"README.md"}