Giter VIP home page Giter VIP logo

u8array's Introduction

Hey there, I'm Benjamin Grant or Be - nothingrandom ๐Ÿ‘‹๐Ÿป

I'm Benjamin, a lead javascript / frontend engineer, based in Brighton.

Mostly working with Typescript and React, with a mix of the latest ES/ECMA spec, and S/CSS. I'm currently focusing on browser extensions, with a strong knowledge of native APIs and the innards of a browser.

During my downtime, there's few things better than playing fetch with my border collie, Nova. My wife, Indy, and I love to take as much time as possible driving to explore hidden beaches, hike in the mountains, and discover trails off the beaten path.

I believe food is the heart of every home, and so keep a small food and recipe blog. I'd love to open my own plant shop-cafe one day, but currently I'm sticking to discovering local favourites.

u8array's People

Contributors

nothingrandom avatar

Stargazers

 avatar

Watchers

 avatar  avatar

u8array's Issues

Not even worth it...

u8array/index.js

Lines 1 to 18 in 178cb30

const u8 = (src) => {
let string = '';
if (typeof src !== 'string') {
string = src.toString();
} else {
string = src;
}
const arrayBuffer = new ArrayBuffer(string.length * 1);
const newUint = new Uint8Array(arrayBuffer);
newUint.forEach((_, i) => {
newUint[i] = string.charCodeAt(i);
});
return newUint;
};
module.exports = u8;

Can all be replaced by this:

var e = new TextEncoder()
module.exports = x => e.encode(x)

Would discourage use of this package and instead encourage ppl to use TextEncoder instead

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.