Lines Matching refs:value

60 function checkInt(value, min, max, buf, offset, byteLength) {
61 if (value > max || value < min) {
74 throw new ERR_OUT_OF_RANGE('value', range, value);
79 function boundsError(value, length, type) {
80 if (MathFloor(value) !== value) {
81 validateNumber(value, type);
82 throw new ERR_OUT_OF_RANGE(type || 'offset', 'an integer', value);
90 value);
580 function writeBigU_Int64LE(buf, value, offset, min, max) {
581 checkInt(value, min, max, buf, offset, 7);
583 let lo = Number(value & 0xffffffffn);
591 let hi = Number(value >> 32n & 0xffffffffn);
602 function writeBigUInt64LE(value, offset = 0) {
603 return writeBigU_Int64LE(this, value, offset, 0n, 0xffffffffffffffffn);
606 function writeBigU_Int64BE(buf, value, offset, min, max) {
607 checkInt(value, min, max, buf, offset, 7);
609 let lo = Number(value & 0xffffffffn);
617 let hi = Number(value >> 32n & 0xffffffffn);
628 function writeBigUInt64BE(value, offset = 0) {
629 return writeBigU_Int64BE(this, value, offset, 0n, 0xffffffffffffffffn);
632 function writeBigInt64LE(value, offset = 0) {
634 this, value, offset, -0x8000000000000000n, 0x7fffffffffffffffn);
637 function writeBigInt64BE(value, offset = 0) {
639 this, value, offset, -0x8000000000000000n, 0x7fffffffffffffffn);
642 function writeUIntLE(value, offset, byteLength) {
644 return writeU_Int48LE(this, value, offset, 0, 0xffffffffffff);
646 return writeU_Int40LE(this, value, offset, 0, 0xffffffffff);
648 return writeU_Int24LE(this, value, offset, 0, 0xffffff);
650 return writeU_Int32LE(this, value, offset, 0, 0xffffffff);
652 return writeU_Int16LE(this, value, offset, 0, 0xffff);
654 return writeU_Int8(this, value, offset, 0, 0xff);
659 function writeU_Int48LE(buf, value, offset, min, max) {
660 value = +value;
661 checkInt(value, min, max, buf, offset, 5);
663 const newVal = MathFloor(value * 2 ** -32);
664 buf[offset++] = value;
665 value = value >>> 8;
666 buf[offset++] = value;
667 value = value >>> 8;
668 buf[offset++] = value;
669 value = value >>> 8;
670 buf[offset++] = value;
676 function writeU_Int40LE(buf, value, offset, min, max) {
677 value = +value;
678 checkInt(value, min, max, buf, offset, 4);
680 const newVal = value;
681 buf[offset++] = value;
682 value = value >>> 8;
683 buf[offset++] = value;
684 value = value >>> 8;
685 buf[offset++] = value;
686 value = value >>> 8;
687 buf[offset++] = value;
692 function writeU_Int32LE(buf, value, offset, min, max) {
693 value = +value;
694 checkInt(value, min, max, buf, offset, 3);
696 buf[offset++] = value;
697 value = value >>> 8;
698 buf[offset++] = value;
699 value = value >>> 8;
700 buf[offset++] = value;
701 value = value >>> 8;
702 buf[offset++] = value;
706 function writeUInt32LE(value, offset = 0) {
707 return writeU_Int32LE(this, value, offset, 0, 0xffffffff);
710 function writeU_Int24LE(buf, value, offset, min, max) {
711 value = +value;
712 checkInt(value, min, max, buf, offset, 2);
714 buf[offset++] = value;
715 value = value >>> 8;
716 buf[offset++] = value;
717 value = value >>> 8;
718 buf[offset++] = value;
722 function writeU_Int16LE(buf, value, offset, min, max) {
723 value = +value;
724 checkInt(value, min, max, buf, offset, 1);
726 buf[offset++] = value;
727 buf[offset++] = (value >>> 8);
731 function writeUInt16LE(value, offset = 0) {
732 return writeU_Int16LE(this, value, offset, 0, 0xffff);
735 function writeU_Int8(buf, value, offset, min, max) {
736 value = +value;
739 if (value > max || value < min) {
740 throw new ERR_OUT_OF_RANGE('value', `>= ${min} and <= ${max}`, value);
745 buf[offset] = value;
749 function writeUInt8(value, offset = 0) {
750 return writeU_Int8(this, value, offset, 0, 0xff);
753 function writeUIntBE(value, offset, byteLength) {
755 return writeU_Int48BE(this, value, offset, 0, 0xffffffffffff);
757 return writeU_Int40BE(this, value, offset, 0, 0xffffffffff);
759 return writeU_Int24BE(this, value, offset, 0, 0xffffff);
761 return writeU_Int32BE(this, value, offset, 0, 0xffffffff);
763 return writeU_Int16BE(this, value, offset, 0, 0xffff);
765 return writeU_Int8(this, value, offset, 0, 0xff);
770 function writeU_Int48BE(buf, value, offset, min, max) {
771 value = +value;
772 checkInt(value, min, max, buf, offset, 5);
774 const newVal = MathFloor(value * 2 ** -32);
777 buf[offset + 3] = value;
778 value = value >>> 8;
779 buf[offset + 2] = value;
780 value = value >>> 8;
781 buf[offset + 1] = value;
782 value = value >>> 8;
783 buf[offset] = value;
787 function writeU_Int40BE(buf, value, offset, min, max) {
788 value = +value;
789 checkInt(value, min, max, buf, offset, 4);
791 buf[offset++] = MathFloor(value * 2 ** -32);
792 buf[offset + 3] = value;
793 value = value >>> 8;
794 buf[offset + 2] = value;
795 value = value >>> 8;
796 buf[offset + 1] = value;
797 value = value >>> 8;
798 buf[offset] = value;
802 function writeU_Int32BE(buf, value, offset, min, max) {
803 value = +value;
804 checkInt(value, min, max, buf, offset, 3);
806 buf[offset + 3] = value;
807 value = value >>> 8;
808 buf[offset + 2] = value;
809 value = value >>> 8;
810 buf[offset + 1] = value;
811 value = value >>> 8;
812 buf[offset] = value;
816 function writeUInt32BE(value, offset = 0) {
817 return writeU_Int32BE(this, value, offset, 0, 0xffffffff);
820 function writeU_Int24BE(buf, value, offset, min, max) {
821 value = +value;
822 checkInt(value, min, max, buf, offset, 2);
824 buf[offset + 2] = value;
825 value = value >>> 8;
826 buf[offset + 1] = value;
827 value = value >>> 8;
828 buf[offset] = value;
832 function writeU_Int16BE(buf, value, offset, min, max) {
833 value = +value;
834 checkInt(value, min, max, buf, offset, 1);
836 buf[offset++] = (value >>> 8);
837 buf[offset++] = value;
841 function writeUInt16BE(value, offset = 0) {
842 return writeU_Int16BE(this, value, offset, 0, 0xffff);
845 function writeIntLE(value, offset, byteLength) {
847 return writeU_Int48LE(this, value, offset, -0x800000000000, 0x7fffffffffff);
849 return writeU_Int40LE(this, value, offset, -0x8000000000, 0x7fffffffff);
851 return writeU_Int24LE(this, value, offset, -0x800000, 0x7fffff);
853 return writeU_Int32LE(this, value, offset, -0x80000000, 0x7fffffff);
855 return writeU_Int16LE(this, value, offset, -0x8000, 0x7fff);
857 return writeU_Int8(this, value, offset, -0x80, 0x7f);
862 function writeInt32LE(value, offset = 0) {
863 return writeU_Int32LE(this, value, offset, -0x80000000, 0x7fffffff);
866 function writeInt16LE(value, offset = 0) {
867 return writeU_Int16LE(this, value, offset, -0x8000, 0x7fff);
870 function writeInt8(value, offset = 0) {
871 return writeU_Int8(this, value, offset, -0x80, 0x7f);
874 function writeIntBE(value, offset, byteLength) {
876 return writeU_Int48BE(this, value, offset, -0x800000000000, 0x7fffffffffff);
878 return writeU_Int40BE(this, value, offset, -0x8000000000, 0x7fffffffff);
880 return writeU_Int24BE(this, value, offset, -0x800000, 0x7fffff);
882 return writeU_Int32BE(this, value, offset, -0x80000000, 0x7fffffff);
884 return writeU_Int16BE(this, value, offset, -0x8000, 0x7fff);
886 return writeU_Int8(this, value, offset, -0x80, 0x7f);
891 function writeInt32BE(value, offset = 0) {
892 return writeU_Int32BE(this, value, offset, -0x80000000, 0x7fffffff);
895 function writeInt16BE(value, offset = 0) {
896 return writeU_Int16BE(this, value, offset, -0x8000, 0x7fff);