# Is it possible to \`reinterpret\` a \`UInt64\` as \`Array{UInt16,1}\`

**URL:** https://discourse.julialang.org/t/is-it-possible-to-reinterpret-a-uint64-as-array-uint16-1/16516
**Category:** General Usage
**Created:** [October 19, 2018, 2:32am UTC](https://discourse.julialang.org/t/is-it-possible-to-reinterpret-a-uint64-as-array-uint16-1/16516 "2018-10-19T02:32:16Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![xiaodai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xiaodai/32/15937_2.png) [@xiaodai](https://discourse.julialang.org/u/xiaodai)
#### Post date: [October 19, 2018, 2:32am UTC](https://discourse.julialang.org/t/is-it-possible-to-reinterpret-a-uint64-as-array-uint16-1/16516/1 "2018-10-19T02:32:16Z")

</div>

One can do

`reinterpret(UInt64, rand(UInt16,4))`

to convert an array of `UInt64` into a `UInt64` but if there a function to do a reverse of that? I tried

`reinterpret(Array{UInt16,1}, rand(UInt64))`

and it doesn’t work. I can do this manually using bitshifts, but I wonder if there is a function that does that already.

---

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [October 19, 2018, 2:34am UTC](https://discourse.julialang.org/t/is-it-possible-to-reinterpret-a-uint64-as-array-uint16-1/16516/2 "2018-10-19T02:34:34Z")

</div>

You could do `reinterpret(UInt16, [rand(UInt64)])`.

However, realize that the results of all of these operations depend on the endianness of the hardware, whereas a bitshift approach does not.
