# No sanity check for \`Principal.fromText()\`

**URL:** https://forum.dfinity.org/t/no-sanity-check-for-principal-fromtext/2292
**Category:** Programs & Applications
**Created:** [March 25, 2021, 7:53pm UTC](https://forum.dfinity.org/t/no-sanity-check-for-principal-fromtext/2292 "2021-03-25T19:53:12Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![cryptoschindler](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/cryptoschindler/32/26_2.png) [@cryptoschindler](https://forum.dfinity.org/u/cryptoschindler)
#### Post date: [March 25, 2021, 7:53pm UTC](https://forum.dfinity.org/t/no-sanity-check-for-principal-fromtext/2292/1 "2021-03-25T19:53:12Z")

</div>

Seems like there is no sanity check for the creation of principals from their textual representation, mainly their CRC32 prefix isn‘t checked. Is this something we can add?  
@alexa.smith @hansl @anon74414410

---

<div class="post-metadata">

### Author: ![hansl](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/hansl/32/134_2.png) [@hansl](https://forum.dfinity.org/u/hansl)
#### Post date: [March 25, 2021, 8:06pm UTC](https://forum.dfinity.org/t/no-sanity-check-for-principal-fromtext/2292/2 "2021-03-25T20:06:27Z")

</div>

In JavaScript? I thought we did, let me check.

---

<div class="post-metadata">

### Author: ![hansl](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/hansl/32/134_2.png) [@hansl](https://forum.dfinity.org/u/hansl)
#### Post date: [March 25, 2021, 8:08pm UTC](https://forum.dfinity.org/t/no-sanity-check-for-principal-fromtext/2292/3 "2021-03-25T20:08:33Z")

</div>

You’re right, let me fix that for you 🙂

---

<div class="post-metadata">

### Author: ![hansl](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/hansl/32/134_2.png) [@hansl](https://forum.dfinity.org/u/hansl)
#### Post date: [March 26, 2021, 2:00am UTC](https://forum.dfinity.org/t/no-sanity-check-for-principal-fromtext/2292/4 "2021-03-26T02:00:31Z")

</div>

The next release of the JavaScript agent should have this fix. Thanks.
