# How to calculate the Radix Resource Id (RRI) for a mutable token

**URL:** <https://radixtalk.com/t/how-to-calculate-the-radix-resource-id-rri-for-a-mutable-token/65>\
**Category:** Developers\
**Tags:** howto, python, replit\
**Created:** [25 December 2021 14:16 UTC](https://radixtalk.com/t/how-to-calculate-the-radix-resource-id-rri-for-a-mutable-token/65 "2021-12-25T14:16:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stuart](https://radixtalk.com/letter_avatar_proxy/v4/letter/s/cab0a1/32.png) [@Stuart](https://radixtalk.com/u/Stuart)\
**Post date:** [25 December 2021 14:16 UTC](https://radixtalk.com/t/how-to-calculate-the-radix-resource-id-rri-for-a-mutable-token/65/1 "2021-12-25T14:16:57Z")

</div>

Replace the `public_key_hex` with the public key used to create the token, and the `symbol` with the token symbol.

```auto
import bech32
import hashlib

public_key_hex = "02690937690ffb9d7ae8b67af05efc03a5a9f7e53933de80f92ce763a5554a1fa3"
symbol = b"rct"

public_key = bytearray.fromhex(public_key_hex)

m = hashlib.sha256()
m.update(public_key + symbol)
hash = m.digest()
n = hashlib.sha256()
n.update(hash)
hash2 = n.digest()

part = hash2[6:32]

readdr_bytes = b"\x03" + part
readdr_bytes5 = bech32.convertbits(readdr_bytes, 8 ,5)

resource_address = bech32.bech32_encode("rct_rr", readdr_bytes5)
print("Resource address: ", resource_address)

# rct_rr1q04fvesft0rsw9s66wrr0ccp30qwfysrdff67q2jxgvqxdcwfz

```

## Run this code on Replit:

https://replit.com/@radixtalk/Public-Key-and-Symbol-to-RRI?embed=true
