1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 10:47:35 +00:00

LibJS: Add all of the DataView.prototype.get* methods

This commit is contained in:
Idan Horowitz 2021-06-14 01:57:15 +03:00 committed by Linus Groh
parent e4d267d4fb
commit c54b9a6920
6 changed files with 206 additions and 0 deletions

View file

@ -41,6 +41,16 @@ public:
return UnsignedBigInteger(ptr, length);
}
static UnsignedBigInteger create_from(u64 value)
{
VERIFY(sizeof(Word) == 4);
UnsignedBigInteger integer;
integer.m_words.resize(2);
integer.m_words[0] = static_cast<Word>(value & 0xFFFFFFFF);
integer.m_words[1] = static_cast<Word>((value >> 32) & 0xFFFFFFFF);
return integer;
}
size_t export_data(Bytes, bool remove_leading_zeros = false) const;
static UnsignedBigInteger from_base10(const String& str);