mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Both `keyFromPrivate` and `keyFromPublic` work with Uint8Array. `keyFromPublic` accepts anything with a length and an indexer, though I'm not sure how to correctly setup the types for that. `keyFromPrivate` works with anything that `BN` works with as input, which includes `Uint8Array`s. The only valid value for `enc` in `getPublic` and `getPrivate` is `hex`, so I narrowed the type on those to only support that instead of `string`. The `compact` boolean on `getPublic` with an `enc` parameter set to anything other than `hex` will yield `[ this.getY().isEven() ? 0x02 : 0x03 ].concat(x)`. I chose the string 'array' as an opinion here so at least future readers of code written to use that overload of `getPublic` can have an idea of what they are getting out when they pass something besides `'hex'` in. (note: if nothing is a falsy value for `enc` is provided when `concat` is truthy, the function will behave the same as if no parameters were passed). |
||
|---|---|---|
| .. | ||
| elliptic-tests.ts | ||
| index.d.ts | ||
| tsconfig.json | ||
| tslint.json | ||