1.0.0 • Published 1 year ago

@f1stnpm3/dolorum-dolore-sed v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

base64 (npm @f1stnpm3/dolorum-dolore-sed)

Build Status Coverage Status

Disclaimer: For node versions < 4 use the 1.2.0 version.

This modules can be used to encoding & decoding messages (strings) and files using base64.

I'm trying to add new features based on other packages to get an all in one npm module. Actually @f1stnpm3/dolorum-dolore-sed can encode and decode: strings, files and strings with XOR encrytion.

nodei.co

Why use this module?

It's minimalist and focused in the best javascript performance.

Install @f1stnpm3/dolorum-dolore-sed module

At cmd, type:

$ npm install @f1stnpm3/dolorum-dolore-sed

or to install this package globally, use:

$ npm install -g @f1stnpm3/dolorum-dolore-sed

After install run unit tests

$ cd ./node_modules/@f1stnpm3/dolorum-dolore-sed/
$ npm install
$ npm test

Do you want a test report?

$ cd ./node_modules/@f1stnpm3/dolorum-dolore-sed/
$ npm install
$ npm test  --coverage

How to use?

To load module functionalities, you must use the require.js properties integrated in node.js.

Example:

var base64 = require('@f1stnpm3/dolorum-dolore-sed');

DOCS

encode (str)

This method is used to encode a plain-text string to a encoded string in base64.

  • Arguments :
  • str - The string you want to encode.
  • type - Encoding Type (This argument is optional) | Available types: 'MIME'.
  • Result : Encoded string in base64.
  • Example :
base64.encode('@f1stnpm3/dolorum-dolore-sed npm module'); // result = YmFzZTY0LW1pbiBucG0gbW9kdWxl
base64.encode('@f1stnpm3/dolorum-dolore-sed npm module', 'MIME'); // result = YmFzZTY0LW1pbiBucG0gbW9kdWxl
                                                 // encoded string in base64, using MIME constraints
decode (str)

This method is used to decode a the base64 message to a plain-text string.

  • Arguments :
  • str - The message (in base64) you want to decode.
  • Result : Our message decoded in plain-text.
  • Example :
base64.decode('YmFzZTY0LW1pbiBucG0gbW9kdWxl'); // result = @f1stnpm3/dolorum-dolore-sed npm module
encodeFile(file)

This method is used to encode files into base64 string.

  • Arguments :
  • file - The file path of the you want to encode.
  • Result : Encoded File into a string in base64.
  • Example :
base64.encodeFile('original.png');
decodeToFile(str,filepath)

This method is used to decode messages and save the result in one file (Tested and functional with PNG Files).

  • Arguments :
  • str - The message (in base64) you want to decode.
  • file - The file path of the you want to save.
  • Result : Decoded File
  • Example :
base64.decodeToFile('ZGF0YQ==', 'result.png') ;
encodeWithKey(str,key)

This method is used to encode messages and encrypt messages using a key (XOR Encryption - Fast and "Secure").

  • Arguments :
  • str - The message in plain-text.
  • key - The key you want to encrypt your message.
  • Result : Encoded encrypted message in base64.
  • Example :
base64.encodeWithKey('@f1stnpm3/dolorum-dolore-sed npm module', 'victorfern91'); // result = FAgQEVlGSwgbABlfBgRDGQAWEwkX
                                                               //(in plain text is YFK_C	)
decodeWithKey(str,key)
  • Arguments :
  • str - The message in base64.
  • key - The key used to encrypt this message.
  • Result : Deciphered message in plain-text.
  • Example :
//Decoding with wrong key
base64.decodeWithKey('FAgQEVlGSwgbABlfBgRDGQAWEwkX', 'npm module'); // result = zx}14)/}wew/k$.vdcly
//Decoding with correct key
base64.decodeWithKey('FAgQEVlGSwgbABlfBgRDGQAWEwkX', 'victorfern91'); // result = @f1stnpm3/dolorum-dolore-sed npm module
sidefile systemclass-validatorObject.getPrototypeOfrgbCSSjsxcloudtrailcoerciblerdseverymkdirpapikarmaperformancedebuggerMicrosoftcallbindECMAScript 3typescriptcore-jscallboundimportexportcolorsescapeArray.prototype.flatchaiwatchreal-timeendpointfsArray.prototype.includespackage managerdomslotcryptgetintrinsicES2018trimRightparseponyfilleslint-pluginjsECMAScript 5xhrfullwidthelmsetImmediatetestingObservablesines7sameValueZerowhatwgregexnpmsortconcatMapwalkingidlejavascriptpnpm9throatargslookrm -frgroupBydirpruneforEachcommand-linetypeswatchingArray.prototype.findLastavaObject.keyscjkarrayirqRFC-6455privateoperating-systemloggerspinnercomputed-typesserializeruuidregular expressioncsscolumnsrangeerrormapreduceamazonemitfigletec2compareargvmodulesmkdirwaitstatelessintrinsicinternalcolorArray.prototype.containsisprotocopychinesetypeconsumetrimEndtaskstdlibes6sigintbyteLengthpromisephoneroutefastcopycss lessstatesearchdiffeslintObject.valuesgetopt__proto__String.prototype.matchAllserializationdeepcopywritablepropertiestrimStartlimitedfetchformatdeepjsonstyleboundchromiummacossyntaxerroreast-asian-widthimportmovefastfast-deep-clonekinesisconsolermstylesheetArrayBufferhasOwnPropertyroute53StyleSheetfolderutilgdprwordbreaknumberYAMLlockfilecurlCSSStyleDeclarationassertObject.entriesrobustratelimitsettingsES6somehasparsingagentbundlerpostcss-pluginmatchesawesomesauceformarraysconcurrencylanguagecoreshebangspeedartimmutabledeep-cloneopencryptoexitwatchFilehashprototypelistenersframeworkrequireoutputsuperstruct$.extendajaxpostcssPushfullpatchform-validationreact-hooksES2016corsoffsetsharedarraybufferinterruptspyyamlredux-toolkitdatastructureTypedArraycircularcall-bindelectronHyBiESnextfunctionshellformses-shimstc39beanstalkES2022lengthroutertslibnodejsArray.prototype.flattenclassnameslazycharacterpolyfillsafeInt32Arrayinternal slotdatefromSetReactiveExtensionsRxJSunicodejoiArray.prototype.flatMaptypanionless.jslibphonenumberrestdayjsthrottlereusefast-cloneArrayURLSearchParamstraverseawaitcachesortedmapemojiqsprettyflagstyleguidedefineauthdom-testing-librarykeyssigtermmimetypesES2017widthwgetvariables in cssmetadatautil.inspectclimonorepocommanderaccessorerror-handlinggetterreact@@toStringTagsuperagentUint32Arrayprivate dataencryptionUint8Arrayjesthookstypedes2017symbolsjsdifftddtimelinuxtypeerrorassigntyped arrayminimalbatchhigher-orderECMAScript 2018dataArrayBuffer#slicebrowserlistremoveES2020ObjectdefinePropertyyupinstallerpathes2016256WeakSetauthenticationlesscssclassesredactmomentcreatequeuebyteOffsetpushECMAScript 2016autoprefixerpackagesreact-testing-librarybannerexecdependency managerprotocol-buffersObject.definePropertyInt8Arrayreduceio-tstsMapdotenvjwtflattenECMAScript 2021logginghelpersfindstringifywritextermfileroutingreducerenumerablehookformmimetoStringTagcompile lessentriespromisesES2015japanesecolourbootstrap cssttyextramatchAllcall-boundpipehasOwnansifunctionalECMAScript 2022descriptionReflect.getPrototypeOfECMAScript 2017String.prototype.trimautoscalingtaketelephonedependencieseventEmitterstreamszodcensorconcatnamevalidpackage.jsonES2019regularconnecttrimLeftspinnersequalvalidationUint16ArrayES8queueMicrotask_.extendasciiexit-code[[Prototype]]symlinkselbcolumnindicatorruntimebindIteratorownJSON-SchemapersistentmergematchrandomnamesdataViewfseventsschemecallbackshamdescriptorfull-widthtoobjectless cssnativebreakfindLastIndexobjtoolsinferencecallObject.isajvstyled-componentsspeceslintpluginchromewebzeroregexpfixed-widthcloudwatchobjectArray.prototype.filterparserterminallimitperformantwalkstylesvariablesgradients cssdirectoryreplayES7urljsdomvalueyamlpreprocessormobilesinatraomitconfigtesterargparsescheme-validationdropgetPromiserm -rfmrustringastebselasticacheerrorstarterrequestTypeScriptcommandguidInt16Arrayswfbundlingcloudformationoncedeepcloneutilities
1.0.0

1 year ago