You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					24 lines
				
				427 B
			
		
		
			
		
	
	
					24 lines
				
				427 B
			| 
								 
											3 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 | 
							
								# cookie-signature
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								  Sign and unsign cookies.
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								## Example
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								```js
							 | 
						||
| 
								 | 
							
								var cookie = require('cookie-signature');
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								var val = cookie.sign('hello', 'tobiiscool');
							 | 
						||
| 
								 | 
							
								val.should.equal('hello.DGDUkGlIkCzPz+C0B064FNgHdEjox7ch8tOBGslZ5QI');
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								var val = cookie.sign('hello', 'tobiiscool');
							 | 
						||
| 
								 | 
							
								cookie.unsign(val, 'tobiiscool').should.equal('hello');
							 | 
						||
| 
								 | 
							
								cookie.unsign(val, 'luna').should.be.false;
							 | 
						||
| 
								 | 
							
								```
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								## License
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								MIT.
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								See LICENSE file for details.
							 |