Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add integers_uint{32|64}_to_hexstring stubs #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,12 @@ function integers_uint32_to_string(i) {
return caml_new_string(i.value.toString());
}

//Provides: integers_uint32_to_hexstring
//Requires: caml_new_string
function integers_uint32_to_hexstring(i) {
return caml_new_string(i.value.toString(16));
}

//Provides: integers_uint64_add
//Requires: caml_int64_add
function integers_uint64_add(x, y) {
Expand Down Expand Up @@ -322,6 +328,12 @@ function integers_uint64_to_string(i) {
return caml_int64_format(caml_new_string("%u"), i);
}

//Provides: integers_uint64_to_hexstring
//Requires: caml_int64_format, caml_new_string
function integers_uint64_to_hexstring(i) {
return caml_int64_format(caml_new_string("%x"), i);
}

//Provides: integers_uint8_of_string
//Requires: integers_uint32_of_string
function integers_uint8_of_string(x) {
Expand Down