Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Differences Between: [Versions 310 and 400] [Versions 311 and 400] [Versions 39 and 400]

SCSSPHP

Copyright: 2012-2020 Leaf Corcoran
License: http://opensource.org/licenses/MIT MIT
File Size: 151 lines (4 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Base64VLQ:: (4 methods):
  encode()
  decode()
  toVLQSigned()
  fromVLQSigned()


Class: Base64VLQ  - X-Ref

Base 64 VLQ

Based on the Base 64 VLQ implementation in Closure Compiler:
https://github.com/google/closure-compiler/blob/master/src/com/google/debugging/sourcemap/Base64VLQ.java

Copyright 2011 The Closure Compiler Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

encode($value)   X-Ref
Returns the VLQ encoded value.

return: string
param: int $value

decode($str, &$index)   X-Ref
Decodes VLQValue.

return: int
param: string $str
param: int    $index

toVLQSigned($value)   X-Ref
Converts from a two-complement value to a value where the sign bit is
is placed in the least significant bit.  For example, as decimals:
1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
2 becomes 4 (100 binary), -2 becomes 5 (101 binary)

return: int
param: int $value

fromVLQSigned($value)   X-Ref
Converts to a two-complement value from a value where the sign bit is
is placed in the least significant bit.  For example, as decimals:
2 (10 binary) becomes 1, 3 (11 binary) becomes -1
4 (100 binary) becomes 2, 5 (101 binary) becomes -2

return: int
param: int $value