npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

gulp-sha

v0.2.1

Published

[Gulp](http://gulpjs.com) plugin for hashing using propular SHA algorithms

Downloads

53

Readme

gulp-sha NPM version node

Library to handle SHA with gulp

Gulp plugin for hashing using popular SHA algorithms.

Information

| Package | gulp-sha | | ---------------------- | ------------------------------------------------------------------- | | Version | v0.2.1 | | Node Version Supported | >= 0.10.0 | | Gulp Version Supported | 4.x | | Author | @computnik |

Usage

Install

npm install gulp-sha --save-dev

Then, add it into your gulpfile.js:

Examples

Input

The following is in the inputfile

This is a dummy File

GulpFile

var gulp = require("gulp");
var gulpSHA = require("gulp-sha");
var inputFile="./inputFile"; // Path to input File
var outputDir="./"; // Path to Output directory
var options = {
  hashType: "SHA-256",
  numRounds: 2,
  useHmac: true,
  hmacKey: "abc"
};
gulp.src(inputFile)
  .pipe(gulpSHA(options))
  .pipe(gulp.dest(outputDir));

Output Generated

c7716ed373d76c4a1a4f8c1b622c6955838cab6fd2260824845dc599bd03a5b0

API

gulp-sha(options)

options.hashType

Type: String Default: SHA-256 Valid Options: SHA-1, SHA-224, SHA3-224, SHA-256, SHA3-256, SHA-384, SHA3-384, SHA-512, SHA3-512, SHAKE128 or SHAKE256 Type of Hashing Algorithm. This should be any one of the available values

options.encoding

Type: String Default: UTF8 Valid Options: UTF8, UTF16BE or UTF16LE Type of Encoding. It specifies the encoding used to encode TEXT-type inputs

options.inputType

Type: String Default: TEXT Valid Options: HEX, TEXT, B64, BYTES, or ARRAYBUFFER This is type of input provided. It can take any of the possible values above.

options.outputType

Type: String Default: HEX Valid Options: HEX, TEXT, B64, BYTES, or ARRAYBUFFER Similar to inputType, specifies the format of output generated

options.numRounds

Type: Integer Default: 1 Number of rounds for hashing.

options.useHmac

Type: Boolean Default: false Valid Options: true or false Flag to enable HMAC aka Hash-based Message Authentication Code.

options.HMACKey

Type: String Default: "" HMAC Key. This needs to be set along with useHmac flag, to set a HMAC key.

options.HMACType

Type: String Default: TEXT Valid Options: HEX, TEXT, B64, BYTES, or ARRAYBUFFER Type of HMAC Key, similar to inputType.

options.outputUpper

Type: Boolean Default: false This option is intelligently interpreted based upon the chosen output format, by jssha library.

options.b64Pad

Type: String Default: = This option is intelligently interpreted based upon the chosen output format, by jssha library.

options.shakeLen

Type: Integer Default: 0 This option is required for SHAKE type of hashing algorithms. Important: SHAKE128 and SHAKE256 require shakeLen to be included in the hashmap whereshakeLen is the desired output length of the SHAKE algorithm in a multiple of 8 bits.

Additional Info

gulp-sha uses jssha. More information about Algorithms can be found there.

License

MIT License