Package Exports
- sass-bitwise
- sass-bitwise/_index.scss
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (sass-bitwise) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
sass-bitwise
A library of 32-Bit Bitwise Operations implemented fully in SASS.
Works similar to standard JavaScript Bitwise Operations. The library assumes inputs are positive integars, but all bitwise operations are performed on 32 bits binary numbers. Before a bitwise operation is performed, the library converts numbers to 32 bits signed integers. After the bitwise operation is performed, the result is converted back to SASS numbers.
Installation
This library can be installed using NPM.
npm install sass-bitwiseUsage
If you are having problems with your imports you may need to use the full path:
@use "../node_modules/sass-bitwise" as bitwise;
Bitwise NOT ( ~ )
SCSS
@use "bitwise" as bitwise;
@debug bitwise.bitNot(2863311530);SASS
@use 'bitwise' as bitwise
@debug bitwise.bitNot(2863311530)Ouput
1431655765Bitwise AND ( & )
SCSS
@use "bitwise" as bitwise;
@debug bitwise.bitAnd(763, 93);SASS
@use 'bitwise' as bitwise
@debug bitwise.bitAnd(763, 93)Ouput
89Bitwise OR ( | )
SCSS
@use "bitwise" as bitwise;
@debug bitwise.bitOr(763, 93);SASS
@use 'bitwise' as bitwise
@debug bitwise.bitOr(763, 93)Ouput
767Bitwise XOR ( ^ )
SCSS
@use "bitwise" as bitwise;
@debug bitwise.bitXor(763, 93);SASS
@use 'bitwise' as bitwise
@debug bitwise.bitXor(763, 93)Ouput
678Bitwise Left Shift ( << )
SCSS
@use "bitwise" as bitwise;
@debug bitwise.bitLShift(763, 3);SASS
@use 'bitwise' as bitwise
@debug bitwise.bitLShift(763, 3)Ouput
6104Bitwise Arithmetic Right Shift ( >> )
SCSS
@use "bitwise" as bitwise;
@debug bitwise.bitSignShift(763, 3);SASS
@use 'bitwise' as bitwise
@debug bitwise.bitSignShift(763, 3)Ouput
95Bitwise Logical Right Shift ( >>> )
SCSS
@use "bitwise" as bitwise;
@debug bitwise.bitRShift(763, 3);SASS
@use 'bitwise' as bitwise
@debug bitwise.bitRShift(763, 3)Ouput
95