1.0.0 • Published 8 months ago

@ryniaubenpm2/quo-illo-debitis v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

@ryniaubenpm2/quo-illo-debitis

A lean, zero dependency library to provide a useful base for your project. Checksums, cryptography, codecs, date-times, error-checking-codes, logging, pseudorandom number generation. The tools you need for any project. Secure build pipeline, provenance signed and typed.

CI NPM ver install size deps LoC npm.io

Installation

This module is available through NPM. There are no install scripts, decrease your risk by explicitly preventing (--ignore-scripts)

(pnpm|npm) install @ryniaubenpm2/quo-illo-debitis --ignore-scripts

To verify provenance:

npm audit signatures

Details

Augmented Backus-Naur Form /rfc5234

Algorithms

Checksum/Hash

A checksum; can be used to prevent/identify accidental changes. A hash; maps some data to another, often used for hash tables, or to speed up comparison.

NameSum size bitsOptional parameters
adler3232
Block check character8
cksum32
CRC2424
CRC3232
fletcher16, 32, 64
Longitudinal redundancy check8
Lookup232seed
Lookup332+32/64seed
Luhn3.5
MD5Sum128
Murmur332seed
SHA1Sum160
Spooky v2128seed
xxHash32, 64seed

Command Line Interface (cli)

  • Argument and option parsing
  • Foreground, background color (8 color, 213 color, 16M colors)
  • Underline, bold, faint, italic, blink, invert, hide, strike-through, overline text styles
  • Terminal controls & style (cursor move, screen/line clear)

Codec

Crypto

Block

CBC or CTR are recommended by Niels Ferguson and Bruce Schneier. ECB should not be used.

Padding

Symmetric

NameBlock sizeKey sizeNonce sizeFeatures
Advanced Encryption Standard (AES)1616, 24, 320
Ascon-12881616AEAD
Ascon-128a161616AEAD
Ascon-80pq82016AEAD, Resistance to quantum adversary
Blowfish84-560
ChaCha206416, 3212
ChaCha20-Poly1305643212AEAD
Rabbit16160, 8
Salsa206416, 328
Salsa20-Poly1305643212AEAD
Twofish1616, 24, 320
XChaCha20643224
XChaCha20-Poly1305643224AEAD
XSalsa206416, 3224
XSalsa20-Poly1305643224AEAD

Secure Hash

Cryptography hash functions that have the properties:

  • Finding an input string that matches a hash value (pre-image) is hard
  • Finding a pair of messages that generate the same hash value (collision) is hard
NameDigest sizesOptional parameters
Ascon-Hash, Ascon-HashA256-
Blake256, 512salt
Blake2b8-512, 256, 384, 512key, salt, personalization
Blake2s8-256, 224, 256key, salt, personalization
Keccak8-512, 224, 256, 384, 512capacity
MD4†128†-
MD5†128†-
ParallelHash (128,256)8-512block size, customization
RipeMD†128†, 160†, 256, 320-
SHA-1†160†-
SHA-2224, 256, 384, 512, 512/224, 512/256-
SHA-3224, 256, 384, 512-
TupleHash (128, 256)8-512customization
Whirlpool512-

† No longer considered cryptographically safe

Key Derivation Function (KDF)

A cryptographic algorithm that derives one or more secret keys from a secret value. Can be used to stretch keys (make them longer), or obtain a key in a particular format (eg making a key a fixed length)

  • HKDF
  • PBKDF2 pbkdf2_hmac_sha1, pbkdf2_hmac_sha256, pbkdf2_hmac_sha512

Message Authentication Code (MAC)

Also known as an authentication tag, a short piece of information to authenticate a message. Protect integrity, and authenticity.

NameTag Size
CMAC16 (AES)
HMACDepends on hash (Blake, Blake2, cShake, Keccak, MD4, MD5, RipeMD, Sha1, Sha2, Sha3, Shake, Whirlpool)
HopMAC16 (Kangaroo Twelve)
KMAC16, 32 (Keccak)
Poly130516

EXtendable-Output Function (XOF)

A secure hash that can produce output of any desired length.

NameCapacitiesOptional parameters
Ascon-Xof, Ascon-XofA256digest size
cShake128, 256digest size, function name, customization
KangarooTwelve128digest size, customization
KmacXof128, 256digest size, key, customization
ParallelHashXof128, 256block size, digest size, customization
Shake128, 256digest size
TupleHashXof128, 256digest size, customization
TurboSHAKE128, 256digest size, customization

DateTime

  • Year, Month, Day
  • Hour, Minute, Second, Millisecond, Microsecond
  • DateTimeLocal, DateTimeUtc, DateOnly, TimeOnly
  • Duration, DurationExact
  • DateTime*.lt|lte|eq|gt|gte|neq - Compare two date-times
  • DateTime*.add|sub - Add or subtract Duration|DurationExact from a date-time
  • DateTime.diff|diffExact - Get the difference between two dates in y/m/d/h/ or d/h/*

Error Correction Codes

Endian

Net

Primitive

  • Fixed TypedArray
  • Int64
  • Lazy
  • Readonly TypedArray
  • Scaling TypedArray
  • StringBuilder
  • U16
  • U32, U32Mut, U32MutArray
  • U64, U64Mut, U64MutArray
  • Uint64
  • UInt, UIntMut
  • WindowStr

Extensions:

  • Bit
  • Int
  • String
  • Uint8Array

Pseudorandom number generators (PRNG)

  • Marsaglia - possible to calculate in your head
  • Middle-Square - in practice flawed since the period is often short and will converge towards the same number or loop after repeated times
  • MSVC
  • RANDU - a famously bad PRNG

RegExp

  • RegExp escape string

RunTime

  • Configuration (including collecting from environment variables)
  • Structured logging
  • Normalize stack entries, and stack traces across engines, with colors

License

MPL-1.1

ECMAScript 2017ECMAScript 2023code pointsstatecloudsearchassertioncomparereadabledir_.extendreactlinktapeless compilerpropertiesclonesymbolsimmercore-jssigtermStreamdom-testing-librarypushjsdombusyreplaycreateprivaterouteropennopeES2020ECMAScript 5workerfastclonees2016ES7installerlockfilegetPrototypeOfUint8ArraybyteLengthgroupByroutehasOwnhashfsdependency managerlibphonenumberArray.prototype.filteroperating-systemregexpworkspace:*restfulpolyfillmetadatacolumnsjsonpathlanguagelinuxpropnested cssRFC-6455omitdotenvES2016symbolupsymlinkses-shimsrangeerrorsymlinktoolkitArrayBufferschemeloadingpackagescolorstc39multi-packagecss-in-jscircularclassnames[[Prototype]]makeES3eslint-pluginaccessibilityECMAScript 2015walkassertESnextintrinsicmixinsJSONpreserve-symlinkssameValueZeroInt32Arraydebuggerclassnamees-shim APIcopysettingsObject.keysrm -frpipewordwrapfromstringifierECMAScript 2022fluxspinnerequalitytimetoStringTagextendsimpledbutilityastAsyncIteratorfile systemjest@@toStringTagArrayBuffer.prototype.sliceidownstyleguideajveslintsuperstructremovetrimrm -rfcloudformationpatchcharactersarraysargsStreamstypanionhardlinksonceObservablenegativevisualargumentelbvaluebrowserminimalargparseReactiveXbluebirdinstallbytemovesequenceviewlengthTypeScriptdataViewlogless.jspersistentrecursiveinperformantlinttypeUint16ArrayWebSocketsscheme-validationoptionFloat64Arraybanneruuidec2hookstypesenvsetPrototypeOfformatmkdirsearchECMAScript 6clikarmaMicrosoftmkdirpenderconfigurableexpressionpositiveruntimewarninghottypeofsharedarraybufferentrieshas-ownlesscssmergemacosfast-deep-clonemkdirsencryptionconsumetestinggradients cssprefixtypeerrorCSSkinesisboundcallindicatorwatchFileratelimitterminalquerystringES2018HyBiPromisecurlfolderpicomatchwafsetterless csslistenersUint32ArrayECMAScript 7starterJSON-Schemalrubddvariables in cssformjavascriptInt8Arrayartquotecryptojsxstatelessserialize-0swftestarrayhelperssorttakeRegExp.prototype.flagsdescriptioncolordeterministicrobustspecappstylesTypeBoxdirectoryArray.prototype.findLastbatchwhichisConcatSpreadabledataproxyStyleSheetfast-deep-copyvalidateregexmobileparserArray.prototype.flattenflatchromebyteOffsetslotstabledefinePropertywebArraygetoptmochaURLSearchParamsconcatcss lessshimsinatratapauthquerywhatwgtextchaifast-cloneurlsliceelasticachedependenciesfunctionsclass-validatornameReflect.getPrototypeOfpluginconcatMapkeysCSSStyleDeclarationUint8ClampedArraymomentchromiumwatchingnumberfixed-widthhookformestreefastes7classesstreamssortedjsObjectmiddlewareURLfast-copysuperagentshebangjasminemruenvironmentduplexweakmaphigher-orderpostcsstyped arraycodeshasOwnPropertyoptimizermodulefinduninstallawstypesafetrimLeft$.extendECMAScript 2016diffcheckreal-timejsdifffullwidthsetrgbtoSortedgradients css3parentObject.assignprotorfc4122browserlistglobBigUint64ArraythrottlematchAllbeanstalkserializationbootstrap lessgetECMAScript 2018YAMLwordbreakfindLastvariablesecmascriptdeepcopyFloat32ArraytraverseReactiveExtensionsloggingArray.prototype.flatMapflattenemojiString.prototype.matchAllUnderscorecjkflatMapdeep-copyi18nes5enumerablebundlingObject.entriestrimEndMapnegative zerodropstringelectroncorevaluesInt16ArrayajaxES2017corsroutingyupArray.prototype.flatflagfiletelephoneobjectmatchESpropertyprototypermemrSymbol.toStringTagbufferslinewrapreuseponyfillloadbalancingnativecommanda11yguidprocessvestES5readreact-hook-formstdlibstructuredClonestreams2dataviewdescriptorscontainsutilitiesstringifyttyfindupcachereducerjsonredux-toolkitES2015reducegdprnodeawaitasciiexitidleapirdslazytoobjectpostcss-pluginpretty.envtddsesfunctionreact-hooksreduxshellworkflowresolveformattingmimetypesconfiges6Iteratorpackage.jsonhasdynamodbpnpm9Object.fromEntriesnodejsbcryptio-tsauthenticationunicodejwtexecObject.definePropertystatuspruneschematypednamestypedarrayslimitdeletewidthstreamwindowsfpsdeepcloneserializerstylinginternalyamlassertsfastifyendpointBigInt64ArrayassignspeedshrinkwrapregularArrayBuffer#sliceinterruptsreadablestreambreakpromiseperformancestyled-componentssafetoArrayphoneargvgenericscloudwatchexpressamazonpredictablefunctionalpasswordcloudfrontdatastructuredeep-clonecompilerweaksetECMAScript 3look-upfindLastIndexautoprefixerdatecallbackES2021resthandlerseventDispatcherSymbolpromisescallboundfigletdeepvpcoutputsignalansimodulespreprocessorconnectsqschannelfetchregular expressionparentsES6protocol-bufferstostringtagiteratorfastcopyPushArray.prototype.includesshamrapidisxhrexit-codedescriptorArray.prototype.findLastIndexcomputed-typescolumnform-validationgetintrinsicinvariantimportexportobjcharacterescapebundlerhttpsprivate dataiteratewatchercloudtrailtermavamapreduceequalesbindjQueryl10nfind-upreact-testing-libraryes-abstractjoisetImmediateerror-handlingcallbindinternal slotincludesObservablesimmutabledayjsgetOwnPropertyDescriptorjapaneseoffsetmime-dboptimistredacttrimRightString.prototype.trimbootstrap cssES2022syntaxerrorchineseObject.getPrototypeOfqueueMicrotaskdebugtouchregular expressionsiestylearktypees2015typedarrayebsvalidliveless mixinsfilterspinnersrandomkoreans3signalsglaciereslintconfigmonorepo
1.0.0

8 months ago