Skip to content
This repository has been archived by the owner on Sep 8, 2020. It is now read-only.

Commit

Permalink
Merge pull request #4 from Dwarfex/master
Browse files Browse the repository at this point in the history
Update Docs
  • Loading branch information
rkeet authored Mar 27, 2019
2 parents ee33abc + 245a4e4 commit 06b7057
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ To encrypt a street name, add `@Encrypted` like so:

/**
* @var string
* @ORM\Column(name="street", type="string", length=255, nullable=true)
* @ORM\Column(name="street", type="text", nullable=true)
* @Encrypted
*/
protected $street;
Expand All @@ -60,13 +60,18 @@ must be provided if not a string. You can do this like so:

/**
* @var int
* @ORM\Column(name="house_number", type="integer", length=20, nullable=false)
* @ORM\Column(name="house_number", type="text", nullable=false)
* @Encrypted(type="int")
*/
protected $houseNumber;

Supported types are [found here](http://php.net/settype).

#### Cypertext representation
The cypher text always results in a string with varying length always longer than 255 chars.
Therefore you should use a datatype capable of representing the full length of it.
Be aware that even an integer property will be handled as a string representation in the database.

### Hashing

Say you'd like to store a password, it should work in much of the same way as the above. However, it is data that should
Expand Down

0 comments on commit 06b7057

Please sign in to comment.