This article explains the concept of hashing in software development and distinguishes it from encryption. Hashing is a one-way process where the original message cannot be retrieved from the resulting hash. Laravel provides a Hasher interface that can be implemented to create new hashing providers. The article also mentions the confusion between hashing and encryption and clarifies the storage of salts for password hashes in the database. Additionally, it discusses Laravel's usage of the Hasher implementation and mentions the Bcrypt hasher provided by Laravel, which supports bcrypt password hashing with adjustable work factor.
This article explains how to create an implementation of Illuminate\Contracts\Hashing\Hasher using PHP's crypt function and the CRYPT_EXT_DES hashing function. The implementation includes the make, check, and needsRehash methods, each with different functionalities. The make method handles the actual hashing, allowing users to supply a salt and control the number of iterations. The check method compares a given value with a hashed value to check if they match. The needsRehash method determines if a hash needs to be rehashed based on the options provided. The code provided includes the complete implementation of the ExtendedDesHasher class.
Learn how to create an implementation of Illuminate\Contracts\Hashing\Hasher using PHP's crypt function and the CRYPT_SHA256 hashing function. Explore each method before examining the full implementation. The make method accepts an $options array, which can include a salt and the number of hashing iterations. The check method compares a known value with a hashed value, using PHP's crypt function. The needsRehash method determines if a hash needs to be rehashed, based on the salt and number of iterations.
This article explains how to create an implementation of Illuminate\Contracts\Hashing\Hasher using PHP's crypt function and the CRYPT_SHA512 hashing function. The article provides the step-by-step process for implementing each method of the contract. Additionally, it introduces the Sha512Hasher class, which extends the Sha256Hasher class and makes a simple change to match the SHA-512 hashing function.
Learn how to create a custom implementation of the Illuminate\Contracts\Hashing\Hasher contract in PHP. This implementation uses PHP's crypt function and the CRYPT_STD_DES hashing algorithm. The implementation includes methods for hashing, checking hashed values, and determining if a hash needs to be rehashed. The implementation also allows for the option of supplying a custom salt. See a complete example of the implementation and usage in the article.
This article explains how to create an implementation of Illuminate\Contracts\Hashing\Hasher in PHP using the crypt function and the CRYPT_MD5 hashing function. The article breaks down each method and provides a complete implementation of the Md5Hasher class at the end. By following this guide, you can create your own custom hashing implementation in Laravel.
The FileLoader class in Laravel is responsible for loading translation files from the file system. By default, the language files are loaded from the /resources/lang/ directory, with each sub-directory within lang/ corresponding to a specific locale. Each locale directory contains PHP files that return key/value pairs for translations. These files are referred to as "groups". The FileLoader implements the LoaderInterface contract, which includes the load and addNamespace methods for loading translations and adding namespaces, respectively. Translation namespaces are used to prevent conflicts between multiple vendors using the same group names for a locale. The * namespace refers to groups in the default /resources/lang directory, and custom namespaces can be added using the addNamespace method.
Learn how to handle pluralization and specific numbers in Laravel's translator. Message tags can be used as comments for different plural translation messages. Laravel allows for handling specific numbers by passing them directly to the translation message. Intervals can also be used in translation messages to match a range of numbers.
Learn about the Bcrypt hasher in Laravel, how to set the number of rounds for the hash calculation, and how to generate and check hashes using the make and check methods. See examples of generating hashes and checking their validity. Also, discover how to determine if a hash needs to be rehashed and how to use the Hash facade to access hasher methods.
The Translator class is responsible for handling interactions between the application and the translation systems. It implements Symfony's TranslatorInterface and provides functions to determine if a translation exists, retrieve translations with replacements, and pluralize translations. The class also allows you to set and get the current locale and fallback locale. You can access the Translator instance from the application container using the translator name.
Wrapping up Forte Phase 0 with the lexer and parser now in private alpha, and kicking off Phase 1 wi...
Read moreA Forte development update: the parser now supports backtracking, improvements to node metadata, ide...
Read moreWrapping up attribute parsing in Forte's HTML parser, from simple HTML attributes to complex, edge-c...
Read moreExploring how Forte's parser extensions can be used to handle complex Blade directives like nested s...
Read moreDigging into parsing Blade and HTML comments while building Forte's HTML parser for Laravel Blade.
Read moreThis week I’m tackling Forte's HTML parser - consolidating Blade, Flux, and Livewire components into...
Read more