• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

NexusPHP / framework / 12657354225

07 Jan 2025 06:43PM UTC coverage: 100.0%. Remained the same
12657354225

Pull #8

github

web-flow
Merge 84ab458a9 into 8baacd33d
Pull Request #8: Implement Nexus Encryption v2

35 of 35 new or added lines in 12 files covered. (100.0%)

993 of 993 relevant lines covered (100.0%)

7.95 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/src/Nexus/Encryption/Encoding/AbstractBase64Encoder.php
1
<?php
2

3
declare(strict_types=1);
4

5
/**
6
 * This file is part of the Nexus framework.
7
 *
8
 * (c) John Paul E. Balandan, CPA <paulbalandan@gmail.com>
9
 *
10
 * For the full copyright and license information, please view
11
 * the LICENSE file that was distributed with this source code.
12
 */
13

14
namespace Nexus\Encryption\Encoding;
15

16
abstract class AbstractBase64Encoder implements EncoderInterface
17
{
18
    public function encode(#[\SensitiveParameter] string $binaryString): string
19
    {
20
        return sodium_bin2base64($binaryString, $this->getBase64Variant());
256✔
21
    }
22

23
    public function decode(#[\SensitiveParameter] string $encodedString, string $ignore = ''): string
24
    {
25
        return sodium_base642bin($encodedString, $this->getBase64Variant(), $ignore);
256✔
26
    }
27

28
    /**
29
     * Get the variant of Base64 encoding to use.
30
     */
31
    abstract protected function getBase64Variant(): int;
32
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc