# Generate a hash in pre-script

**URL:** <https://community.postman.com/t/generate-a-hash-in-pre-script/15348>\
**Category:** Help Hub\
**Created:** [August 27, 2020, 4:14am UTC](https://community.postman.com/t/generate-a-hash-in-pre-script/15348 "2020-08-27T04:14:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lowkeysam](https://avatars.discourse-cdn.com/v4/letter/l/f04885/32.png) [@lowkeysam](https://community.postman.com/u/lowkeysam)\
**Post date:** [August 27, 2020, 4:14am UTC](https://community.postman.com/t/generate-a-hash-in-pre-script/15348/1 "2020-08-27T04:14:29Z")

</div>

Hey, how do I generate a hash for a signature in the prescript with the following inputs? The end result needs to spit out: signature = BASE64 ( HASH ( http\_method + url\_path + salt + timestamp + access\_key + secret\_key + body\_string ) )

 ![Screenshot 2020-08-27 at 12.09.23 PM](https://us1.discourse-cdn.com/getpostman/original/3X/f/f/ffea64ddc847404de7d62d4fe615d3400092cb16.png)

I’m pulling the signature through into the header with {{signature}}.

I have tried with the keys/values in the headers and body, what am I doing wrong? Also, how can I check the output of a “Pre-script request”?

I’m able to do it in python through an IDE without any worries but haven’t been able to replicate via Postman.

Thanks,

sam

---

<div class="post-metadata">

**Author:** ![vdespa](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/vdespa/32/2770_2.png) [@vdespa](https://community.postman.com/u/vdespa)\
**Post date:** [August 27, 2020, 12:45pm UTC](https://community.postman.com/t/generate-a-hash-in-pre-script/15348/2 "2020-08-27T12:45:36Z")

</div>

You did not actually mention what is not working, what is being sent…

I would check the value of the signature, once the “computation” is done.

`console.log(signature);`
