mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 04:50:18 +00:00
feat(pkcs7-padding): Added types for the pkcs7-padding package (#37687)
This commit is contained in:
committed by
Pranav Senthilnathan
parent
6918b0f6bb
commit
41fa048193
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
// Type definitions for pkcs7-padding 0.1
|
||||
// Project: https://github.com/neeh/pkcs7-padding#readme
|
||||
// Definitions by: Svet Nikolov <https://github.com/svetkomir>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
export function pad(data: Buffer, size: number): Buffer;
|
||||
export function pad(data: string, size: number): string;
|
||||
export function unpad(data: Buffer): Buffer;
|
||||
export function unpad(data: string): string;
|
||||
@@ -0,0 +1,7 @@
|
||||
import * as pkcs7 from 'pkcs7-padding';
|
||||
|
||||
const paddedValue: string = pkcs7.pad('string to pad', 32);
|
||||
const paddedBufferValue: Buffer = pkcs7.pad(Buffer.from('string to pad'), 32);
|
||||
|
||||
const unPaddedValue: string = pkcs7.pad(paddedValue, 32);
|
||||
const unPaddedBufferValue: Buffer = pkcs7.pad(paddedBufferValue, 32);
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"pkcs7-padding-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user