WIP: try to convert to ES modules

This commit is contained in:
j 2026-02-09 18:59:12 +01:00
commit 299a08b6a3
29 changed files with 3003 additions and 2014 deletions

View file

@ -1,9 +1,21 @@
'use strict';
import * as OxObject from './Object.js';
import * as OxConstants from './Constants.js';
import * as OxMath from './Math.js';
const Ox = {};
Object.assign(Ox,
OxObject,
OxConstants,
OxMath
);
/*@
Ox.oshash <f> Calculates oshash for a given file or blob object. Async.
@*/
Ox.oshash = function(file, callback) {
export function oshash(file, callback) {
// Needs to go via string to work for files > 2GB
var hash = fromString(file.size.toString());
@ -100,7 +112,7 @@ Ox.oshash = function(file, callback) {
/*@
Ox.SHA1 <f> Calculates SHA1 hash of the given string
@*/
Ox.SHA1 = function(msg) {
export function SHA1(msg) {
function rotate_left(n,s) {
var t4 = ( n<<s ) | (n>>>(32-s));