Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ascii-codes

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ascii-codes

ASCII table reference and lookup functions

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11
increased by120%
Maintainers
1
Weekly downloads
 
Created
Source

ascii-codes

ASCII table reference and lookup functions

npm install ascii-codes

Usage

var ascii = require('ascii-codes');
var assert = require('assert');

assert.equal("A", ascii.symbolForDecimal(65));
assert.equal("A", ascii.symbolForHex("41"));
assert.equal("A", ascii.symbolForOctal("101"));

assert.equal(65, ascii.decimalForSymbol("A"));
assert.equal("41", ascii.hexForSymbol("A"));
assert.equal("101", ascii.octalForSymbol("A"));

/*
	Note: You can write number literals in hex and octal. Use symbolForDecimal() for those.
*/
assert.equal("A", ascii.symbolForDecimal(0x41));
assert.equal("A", ascii.symbolForDecimal(0101));

Documentation

ascii-codes
    symbolForDecimal(Number) String
		returns the symbol for a given decimal 
    symbolForHex(String) String
		returns the symbol for a given hexidecimal string 
    symbolForOctal(String) String
		returns the symbol for a given octal string 
    decimalForSymbol(String) Number
		returns the decimal for a given symbol 
    hexForSymbol(String) String
		returns the hexidecimal string for a given symbol 
    octalForSymbol(String) String
		returns the octal string for a given symbol 
    symbolIndex Array[String]
		contains the table of ASCII codes 

Contributing

Issues and pull requests are welcome.

# running tests
npm test

Follow me on Twitter for updates or just for the lolz and please check out my other repositories if I have earned it. I thank you for reading.

Keywords

FAQs

Package last updated on 05 Apr 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc