-
Notifications
You must be signed in to change notification settings - Fork 0
/
int-array-converter.html
81 lines (68 loc) · 3.54 KB
/
int-array-converter.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
---
layout: page-comment
comments: true
title: Int to byte array converter (and vice versa)
description: Int to byte array converter and vice versa. hex or decimal bytes.
---
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
<link rel="stylesheet" href="/css/custom.css">
<script src="https://code.jquery.com/jquery-3.6.2.slim.js"
integrity="sha256-OflJKW8Z8amEUuCaflBZJ4GOg4+JnNh9JdVfoV+6biw=" crossorigin="anonymous"></script>
<script type="text/javascript" src="/js/convert.js"></script>
<body>
<div style="margin:1em 0;">
Enter the byte array on top (choose hex or decimal format). Convert down to turn to an int (64 bits).
Alternatively, enter the int on the bottom, and click Convert Up to turn into byte array. For an explanation of the code, click <a href="../tools/2023/12/01/int-to-byte-array-converter.html">here</a>.
</div>
<div style="margin:1em 0;">
Byte array is Big-Endian, unsigned ints.
</div>
<div class="row no-gutter">
<div class="col-xs-9">
<div class="mb-3 input-group ">
<label for="byte1" class="input-group-text">1</label>
<input type="text" class="convert-input form-control" id="byte1">
<label for="byte2" class="input-group-text">2</label>
<input type="text" class="convert-input form-control" id="byte2">
<label for="byte3" class="input-group-text">3</label>
<input type="text" id="byte3" class="convert-input form-control">
<label for="byte4" class="input-group-text">4</label>
<input type="text" id="byte4" class="convert-input form-control">
<label for="byte5" class="input-group-text">5</label>
<input type="text" id="byte5" class="convert-input form-control">
<label for="byte6" class="input-group-text">6</label>
<input type="text" id="byte6" class="convert-input form-control">
<label for="byte7" class="input-group-text">7</label>
<input type="text" id="byte7" class="convert-input form-control">
<label for="byte8" class="input-group-text ">8</label>
<input type="text" id="byte8" class="convert-input form-control">
<select id="byteFormat" class="convert-input" style="float:right">
<option value="decimal">Decimal</option>
<option value="hex">Hex</option>
</select>
</div>
</div>
</div>
<div class="convert-wrapper">
<button type="button" id="convertToInt" class="btn-danielle btn-convert btn">Convert
Down</button>
<button type="button" id="clear" class="btn-danielle btn-convert btn">Clear</button>
<button type="button" id="convertToArray" class="btn-danielle btn-convert btn">Convert
Up</button>
</div>
<div class="row" style="margin:0 2em;">
<div class="convert-wrapper input-group align-items-center ">
<label for="result" class="input-group-text">Int</label>
<input type="text" id="result" class="convert-input form-control">
</div>
</div>
<i>
<p style="text-align:center;margin-top: 5em;">Found it useful?</p>
</i>
<div align="center" style="flex-shrink: unset;">
<script type="text/javascript" src="https://cdnjs.buymeacoffee.com/1.0.0/button.prod.min.js" data-name="bmc-button"
data-slug="369WkrTTU6" data-color="#000000" data-emoji="🍫" data-font="Cookie" data-text="Buy me a hot chocolate"
data-outline-color="#ffffff" data-font-color="#ffffff" data-coffee-color="#FFDD00"></script>
</div>
</body>