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

dna-data-storage

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

dna-data-storage

A simple demonstration of DNA data storage encoding and decoding.

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source
# DNA Data Storage Module

This module provides a simple demonstration of DNA data storage encoding and decoding. It exports two functions, binaryToDNA and DNAToBinary, which convert binary data into a DNA-like sequence and then decode it back into binary data.

Installation

To install this module, you can clone the repository and then run npm install:

git clone https://github.com/hj91/dna-data-storage.git
cd dna-data-storage
npm install

Usage

You can use this module in your code like this:

// Import the module
const { binaryToDNA, DNAToBinary } = require('dna-data-storage');

// Convert binary to DNA
let binary = '01100110'; // This is binary for the ASCII character 'f'
let dna = binaryToDNA(binary);
console.log(`Binary ${binary} is converted to DNA sequence: ${dna}`);

// Convert DNA back to binary
let binaryBack = DNAToBinary(dna);
console.log(`DNA sequence ${dna} is converted back to binary: ${binaryBack}`);

In this example, we're importing the binaryToDNA and DNAToBinary functions from the module. We then use binaryToDNA to convert a binary string to a DNA sequence, and DNAToBinary to convert the DNA sequence back to binary.

Author

Harshad Joshi (@hj91)

License

MIT

Keywords

FAQs

Package last updated on 20 May 2023

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